updateResources(payload: Object, storeUpdater: Function | Object)
dispatch
MobX: @observable resources = {};
React Component State: setState
updateResource(resource: Object, storeUpdater: Function | Object)
{ id, type, attributes, relationships }
dispatch
MobX: @observable resources = {};
React Component State: setState
removeResource(resource: Object, storeUpdater: Function | Object)
{ id, type }
dispatch
MobX: @observable resources = {};
React Component State: setState
query(resources: Object) => Query
{ exampleResources: { id, type, attributes, relationships } }
Query
instance which you will be able to chain the other selector methods onto.all() => Query
where(params: Object) => Query
{ exampleParameter: "Value that will be used to filter by" }
where
method allows you to filter the resources you are selecting.find(id: string | number) => ModelInstance
1
or "1"
find
method returns a model instance with the id that was passed to the method.whereRelated(relationship: ModelClass, params: Object) => Query
{ exampleParameter: "Value that will be used to filter by" }
whereRelated
method allows you to filter resources by related model attributes.includes(relationships: Array<string>) => Query
["exampleResources"]
includes
method will setup the query object to included the related models when converting it to an object.toModels() => Array<ModelInstance>
toObjects() => Array<Object>
first() => ModelInstance
last() => ModelInstance