Yarikx / reductor

Redux for Android. Predictable state container library for Java/Android
Apache License 2.0
463 stars 27 forks source link

Side Effects #40

Closed jQrgen closed 5 years ago

jQrgen commented 5 years ago

Heya

How can we go about implementing Side Effects using reductor library?

... we probably want that our app has in disk persistence using a DB, and/or we want to add a network layer so we can sync our data to the cloud. This is done by side effects.

The concept is copied from this blogpost

As far as i can see the closest we can get is to subscribe to the store and have side-effects automatically updating firebase in that way.

dector commented 5 years ago

In Redux definition Reducer is pure function so it can't have side effects. Middleware is used instead.

Take a look at this article for details.

Also you can take a look and android-oriented solution from Cesar Valiente (youtube)

jQrgen commented 5 years ago

Thanks