Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function appendState(promise) {
- if (promise instanceof Promise) {
- promise.state = 'pending';
- promise.then(x => {
- promise.state = 'resolved';
- });
- promise.catch(e => {
- promise.state = 'rejected';
- });
- }
- return promise;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement