Smart Collections with Dependency Resolution using Immutable.js for Fluorine.
Fluorine Orchestra
About
Keeping a local copy of your database collections can be troublesome. Rewriting code to handle CRUD operations, normalize incoming data and resolve dependencies is not something to do every day.
Orchestra implements a data orchestration layer for Fluorine to easily solve your collection worries.
- Handles data as collections with Immutable's OrderedMaps
- Simple API to describe stores and dependencies
- Automatically resolves dependencies
- Easy observing of missing items inside collections
Quick Intro
This is just a short example that quickly presents most features of Orchestra. It is of course not representetive for how to use it in real React projects.
const dispatcher = // Create stores for your collectionsconst PostStore = const UserStore = ; // Assemble the orchestra of storesconst orchestra = ; const posts // It spits out Fluorine stores (Observables) emitting your resolved state users} = orchestra; // Inserting items?dispatchernextUserStore; // Get Creative: Fetch missing ids that Orchestra can't find in its collectionsconst subscription = PostStore ;
You can easily create stores for your different collections and define how to transform them when they're being fed from the server into your stores. Also define which dependencies they have and how to resolve them. The Orchestra will combine all stores and resolve the dependencies.
The result are normal Fluorine stores (Observables). You can pass these on, as you'd like.
If some items are missing, their ids will be reported on the respective stores. You can use this to fetch missing data on demand.
Method to create actions to insert, remove, filter or update items on the store are already present and can immediately be used.
Frequently Asked Questions
When is Fluorine Orchestra right for me?
It is a perfect fit for your project if:
- you already use or want to use Fluorine as your state and side effect manager
- your data collections are big and have complex dependencies
- you quickly want to store collections and develop rapidly
- you like using Immutable.js