Async mixins and beforeModel


#1

Hey, I’d like to ask about approach to issue with multiple mixins implementing async beforeModel. Let me show example https://ember-twiddle.com/6aa784f1c7a3872e6a20787382c6611a?openFiles=routes.application.js%2C

As you can see model in route wait only for mixin2 resolution. Is there any existing approach to that issue ?

I already have some idea hot to solve it, but was curies if anyone had similar issue.

Thanks,


#2

@CezaryH If you need to chain the behavior of the beforeModel mixins, I think you need to return this._super(...arguments). Since each returns a promise, this will ensure they block until the next one resolves. I tried tweaking your twiddle to that for reference here.