Orbit state tree
Library based on OrbitJS that manages a single state tree to be used on Flux stores (Redux and Vuex)
Basic usage
const StateTree recordSelector requestSelector = const Schema = const Store = default const schema = models: planet: attributes: name: type: 'string' classification: type: 'string' relationships: moons: type: 'hasMany' model: 'moon' inverse: 'planet' moon: attributes: name: type: 'string' relationships: planet: type: 'hasOne' model: 'planet' inverse: 'moons' const store = schemaconst stateTree = schema: schema store: store let appState = {} // Your app state treelet result = stateTreestateTreestateTree stateTree
Tree structure example
entities: articles: '1': attributes: id: '1' title: 'title' relationships: author: type: 'users' id: '2' users: '2': attributes: id: '42' name: 'John' requests: d99e3c57: id: 'd99e3c57' completed: false results: articles: '1' error: {}