Last active
January 14, 2017 04:21
-
-
Save ORESoftware/42c24fbb4a02cd64e6c38a48d0a20a1e to your computer and use it in GitHub Desktop.
Async or sync resolution?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(1); | |
new Promise(function(resolve,reject){ | |
console.log(2); | |
resolve(); | |
}).then(function(val){ | |
console.log(3); | |
}); | |
const Rx = require('rxjs'); | |
let obs = Rx.Observable.create(sub => { | |
console.log(4); | |
sub.next(); | |
}); | |
obs = obs.map(v => { | |
console.log(5); | |
return 'foo'; | |
}); | |
obs.subscribe(v => { | |
console.log(6); | |
// 'foo' | |
}); | |
console.log(7); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment