Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mplewis/composable-reflux
Compose Reflux stores from testable, segmented features
https://github.com/mplewis/composable-reflux
Last synced: 2 months ago
JSON representation
Compose Reflux stores from testable, segmented features
- Host: GitHub
- URL: https://github.com/mplewis/composable-reflux
- Owner: mplewis
- License: mit
- Created: 2018-01-15T18:47:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T08:32:06.000Z (almost 2 years ago)
- Last Synced: 2024-04-13T04:56:06.845Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 524 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Composable Reflux stores
Dedupe functionality common to your Reflux stores by extracting them into composable ES6 class wrappers.
# Install and run
```sh
yarn install
yarn poi
open http://localhost:4000
```# Check out the code
Open `src/app.jsx` in your favorite editor.
# How does this work?
The base store, CounterStore, provides an `increment` Action (in CounterActions) and a `count` state variable. When we use this store in ``, we extend it:
```js
const AugmentedStore = Flightable(CounterStore);
```The Flightable function creates a subclass of CounterStore that adds a `fetch` action (in FlightableActions) and an `inFlight` state variable. `fetch` modifies `inFlight` without touching any of the existing behavior of CounterStore.
# License
MIT