Skip to content

Commit cee0e66

Browse files
committed
Model Store and Collection Store
1 parent 008d69c commit cee0e66

File tree

13 files changed

+22
-18
lines changed

13 files changed

+22
-18
lines changed

_collection-store/cache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ header: cache
33
example: CollectionStore.cache
44
---
55

6-
An object of collections to store data in memory to reduce the number of round trips to the API. Overriding data or modifying the cache is not recommended, however it is helpful to inspect data.
6+
An object of collections that stores data in memory to reduce the number of round trips to the API. Overriding data or modifying the cache is not recommended, but it is helpful for inspecting the data.
77

_collection-store/clear.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ header: clear
33
example: CollectionStore.clear([collectionName], [params])
44
---
55

6-
Clears the collection from the cache. Passing both parameters will clear a specific collection, that matches the `collectionName` and `params`. Passing only the `collectionName` will clear all instances of that collection. Passing no parameters will clear all collections from the store.
6+
Removes the collection from the cache. Passing both parameters will clear a specific collection that matches the `collectionName` and `params`. Passing only the `collectionName` will clear all instances of that collection. Passing no parameters will clear all collections from the store.
77

_collection-store/expireSeconds.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ header: expireSeconds
33
example: CollectionStore.expireSeconds
44
---
55

6-
The time in seconds the collection will live in the store for. By default this is set to `null`, so the data will not expire until a page reload.
6+
The length of time that the collection will be stored, in seconds. By default this is set to `null`, so the data will not expire until the page is reloaded.

_collection-store/get.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ header: get
33
example: CollectionStore.get(collectionName, params, [callback])
44
---
55

6-
Returns the collection from the store based on the collection name and it's [params](/collection#params).
6+
Returns the collection from the store based on the collection name and its [params](/collection#params).
77

88
You can also use the `get` function asynchronously by passing a `callback` function.
99

1010
```js
1111
// async
12-
fetcher.collectionStore.get('users', {ids: [1,2,3]}, function (result) {
13-
// can access the users in the result
12+
fetcher.collectionStore.get('UsersCollection', { ids: [1,2,3] }, function (result) {
13+
// do something with the users
1414
});
1515

1616
// sync
17-
var result = fetcher.collectionStore.get('users', { ids: [1,2,3] })
17+
var result = fetcher.collectionStore.get('UsersCollection', { ids: [1,2,3] })
1818

1919
```

_collection-store/set.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ header: set
33
example: CollectionStore.set(collection, params)
44
---
55

6-
Adds the collection to the [cache](#cache). The params for the collection are required to use as part of a unique identifier for the collection.
6+
Adds the collection to the [cache](#cache). The params for the collection are used as part of a unique identifier for the collection.

_model-store/cache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ header: cache
33
example: ModelStore.cache
44
---
55

6-
An object of models to store data in memory to reduce the number of round trips to the API. Overriding data or modifying the cache is not recommended, however it is helpful to inspect data.
6+
An object of models that stores data in memory to reduce the number of round trips to the API. Overriding data or modifying the cache is not recommended, but it is helpful for inspecting the data.
77

_model-store/clear.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ header: clear
33
example: ModelStore.clear([modelName], [id])
44
---
55

6-
Removes the model(s) from the [cache](#cache). If you pass both the `modelName` and the `id` it will clear that model from the store. If you only pass the `modelName` it will clear all of the models of that type in the store. Passing no arguments will clear the entire model store.
6+
Removes the model(s) from the [cache](#cache). If you pass both the `modelName` and the `id` it will clear that model from the store. If you only pass the `modelName` it will clear all of the models of that type in the store. Passing no arguments will clear the entire model store.
77

_model-store/expireSeconds.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ header: expireSeconds
33
example: ModelStore.expireSeconds
44
---
55

6-
The time in seconds the model will live in the store for. By default this is set to `null`, so the data will not expire until a page reload.
6+
The length of time that the model will be stored, in seconds. By default this is set to `null`, so the data will not expire until the page is reloaded.

_model-store/find.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ header: find
33
example: ModelStore.find(modelName, attrs)
44
---
55

6-
Returns the first instance found that matches the `modelName` and `attrs` sent. The `modelName` is the name of the model, the `attrs` is an object of attributes that the model is trying to find.
6+
Returns the first instance found that matches the `modelName` and `attrs` sent. The `modelName` is the name of the model, the `attrs` is an object of parameters to search on.
77

8+
Example:
9+
```js
10+
modelStore.find('Media', { type': 'photo', 'id': 16 })
11+
```

_model-store/get.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ header: get
33
example: ModelStore.get(modelName, id)
44
---
55

6-
Returns the model from the store. Requires the name of the model and the model's `id`.
6+
Returns the model from the store. Requires the name of the model and the model's `id`.

0 commit comments

Comments
 (0)