Created
January 24, 2018 14:37
-
-
Save hergaiety/80372023ad1210f73d98e5d0ab361d00 to your computer and use it in GitHub Desktop.
Leveraging async/await for the Ember runloop, simply.
This file contains hidden or 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
const emberRunloop = (queue = 'sync') => new Promise(resolve => { | |
scheduleOnce(queue, () => { | |
resolve(); | |
}); | |
}); | |
export default Component.extend({ | |
async _myFunction() { | |
await emberRunloop('afterRender'); | |
// Do your stuff after above specified ember runloop | |
// https://guides.emberjs.com/v2.18.0/applications/run-loop/#toc-toggle | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment