Using angular $q, i'm questioning myself if i should use $$state private properties to inspect the state of a promise (to check if it's pending, or completed).
Assuming a situation like this:
var promise = undefined;
$scope.click = function(){
if(promise != null && promise.$$state.status === 0)
return;
promise = doAsyncAnimation().then(function(){
console.log('hey, i'm done!');
});
}
It is considered a bad practise? It would do exactly what i need, and i don't like use a separate boolean variable to do job. How much eligible would it be?