javascript - Shortest way to find Promise object status in chrome developer tool? -




i working angular js , need know status of promise object whether in pending/fulfilled/rejected status?

in chrome developer tool ( v 60 ),

  1. select variable , choose stored global variable (temp1)

     temp1;  deferred {promise: promise, resolve: ƒ, reject: ƒ, notify: ƒ} 
  2. write below statement check promise object status .

    temp1.then(() => { console.log('resolved'); })      .catch(()=> { console.info(''rejected'); }); 

although working fine. looking alternative / different approach same in shorter way.

temp1.isrejected // return true/false temp1.isresolved // return true/false 

i checked 1 suggestion can write method in console , can run temp1 variable again this, need write method on each new tab cumbersome.

any suggestion or help?

in case using chrome's native promises, can @ promise's [[promisestatus]] property:

enter image description here


with standard $q promises in angularjs (i assume talking angular 1.x), can check $$state property:

enter image description here





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -