So I’ve been experimenting lately with state management in Ember. I’m looking to see if the idea has any flaws before I invest more time in it.
Basically, the addon is inspired from Ember Data and Redux. The idea is to have an immutable model-based state in which your Routes can subscribe to for changes. When a state changes, all subscribed Routes will call their
refresh() function. Because states are immutable, the Route will pass-in a new
model to its Controller effectively rerendering the view.
Here’s my WIP addon.
My concern is with the
refresh() as it can do so little and at the same time do so many things depending on the app. I’m wondering if there’s any edge case to look out for. So far I could only think of that it should resolve to the cached records when the
refresh() has been called.
So, does anyone have any idea on why this idea wouldn’t work?