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 ),
select variable , choose stored global variable (
temp1
)temp1; deferred {promise: promise, resolve: ƒ, reject: ƒ, notify: ƒ}
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:
with standard $q
promises in angularjs (i assume talking angular 1.x), can check $$state
property:
wiki
Comments
Post a Comment