alexeieleusis / greencat

A port of Redux(https://github.com/reactjs/redux) to Dart, including Redux Thunk(https://github.com/gaearon/redux-thunk) and a simple Logger.
Apache License 2.0
48 stars 4 forks source link

Flutter example Stream.listen #16

Closed theobouwman closed 7 years ago

theobouwman commented 7 years ago

In found that in the Flutter example's initState() method there is a listener on the stream of the store's state object:

store.stream.listen((AuthState state) {
   setState(() {
     _googleSignInAccount = state.googleSignInAccount; // my own state property
   });
});

should I use this mechanism to for example rebuild a list of items when the list changes?

alexeieleusis commented 7 years ago

Probably, but sounds like an overkill, Isn't there any other way to keep that reference? I would at least filter for different instances.

The flutter example is quite outdated, I need to relearn Flutter and update it.