Cretezy / redux_persist

Persist Redux State
https://pub.dartlang.org/packages/redux_persist
MIT License
130 stars 41 forks source link

PersistLoadingAction missing in 0.8 #41

Closed zaubererty closed 5 years ago

zaubererty commented 5 years ago

What is the concept of replacing this action. I have issues without being notified when a load happens.

Please advice.

Btw I miss a breaking change notice.

Cretezy commented 5 years ago

The CHANGELOG states that they were removed and are a breaking change (as expected by the major version bump, minor for <1.0.0).

Basically, you should call .load() manually instead of relying on actions. This makes loading much simpler, as it's always called before the application load. See the README for an example.

Is there any use case that isn't covered by this?

zaubererty commented 5 years ago

I did some additional loading when the app state has been loaded.

The other use case where to get notified when loading is complete to do additional work.

Off cause you can do the loading and all the other stuff by your self but then I might switch better to the BloC pattern and do everything myself.

Oh now I see "Breaking: Change saving/loading" means removed actions, sorry my mistage.

Cretezy commented 5 years ago

You can easily do this current. Simply dispatch your own action after loading.

persistor.load().then(() => store.dispatch(LoadedAction()));