|
|
|
|
|
by zilean
3737 days ago
|
|
Ember has default model() hook for routes, and propose to add extra data fetching you need in children components into afterModel hook. Everything is working just like you would set it up with React, except that with Ember declaring data dependencies on route is existing convention. And React gives you maybe a little bit more control around that. |
|
That makes sense, I believe that's exactly what react-async does (if I recall correctly?) with react-router.
For our project, we basically call "await ApiActions.getData(routeParams)" in the server's route, after pulling that params out, which is effectively the same idea, and it worked quite well. I'm curious how one would tackle that from a different perspective, but it seems we all end up coming to the same conclusion!