stream_store 0.1.0 copy "stream_store: ^0.1.0" to clipboard
stream_store: ^0.1.0 copied to clipboard

Dart 1 only

A Redux-style Store implemented using core Dart Stream primitives

stream_store #

Build Status codecov

Redux-style state management built with Dart Primitives. The Store is a simple Stream<State> and a Sink<Action>. This means you can add (aka dispatch) new actions to the Sink<Action>.

If you add an action, it will then run through the provided reducer. Reducers are pure functions that should only update the state in response to actions. The updated state will then be emitted to anything that is listening to the Store's Stream<State>.

If you need to perform side-effects, such as communicating with a web server or database, you can write an Effect. Each effect will receive the Stream<State> and the Stream<Action>. You can then use these streams to make async calls in response to an action.

Disclaimer #

I have no idea if anyone wants to use this or if it's even necessary given the fact that there are other Dart Redux solutions out there, but I did it as a thought experiment to see how close to the core Dart primitives we could get and thought I might as well publish it.

0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A Redux-style Store implemented using core Dart Stream primitives

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

logging, rxdart

More

Packages that depend on stream_store