stream_store 0.1.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 50

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.

Changelog

0.1.0

  • Breaking changes: Remove state transformers. You an just transform the Store's Stream<State> however you like.
  • Only allow the use of Effect for side-effects instead of transformers. Effects cannot swallow actions that are added to the Stream, and work with both a Stream<Action> and a Stream<State>.
  • Migrate LoggingTransformer to LoggingEffect. Improve functionality.

0.0.2

  • Move to github
  • Bump Rx

0.0.1

  • Initial version with simple Stream-based API

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  stream_store: "^0.1.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:stream_store/stream_store.dart';
        
Version Uploaded Documentation Archive
0.1.0 Nov 28, 2017 Go to the documentation of stream_store 0.1.0 Download stream_store 0.1.0 archive
0.0.1 Jul 26, 2017 Go to the documentation of stream_store 0.0.1 Download stream_store 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Feb 3, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
50

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:stream_store/stream_store.dart.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use stream_store.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.21.0 <2.0.0
logging >=0.11.3 <0.12.0 0.11.3+1
rxdart >=0.15.0 <0.16.0 0.15.0
Dev dependencies
test