Skip to content

Commit 64ef508

Browse files
committed
Fetcher docs, except hydrate still needs work
1 parent 0e85d4a commit 64ef508

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

_fetcher/fetch.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ header: fetch
33
example: Fetcher.fetch(fetchSpec, [options], callback)
44
---
55

6-
`fetchSpec` is an object with the information to fetcher [Models](/model) or [Collections](/collection).
6+
Fetches [Models](/model) or [Collections](/collection) according to the parameters defined in the `fetchSpec` and populates the corresponding ModelStore and/or CollectionStore.
77

88
Example `fetchSpec`:
99

@@ -28,16 +28,16 @@ Example `fetchSpec`:
2828
}
2929
```
3030

31-
This `fetchSpec` will get two models, the User and Character models, and one collection, the StarWarsCharacters collection.
31+
This `fetchSpec` will get two models (the User and Character models) and one collection (the StarWarsCharacters collection).
3232

33-
Extra options to pass a `fetchSpec`:
33+
Extra options to pass to a `fetchSpec`:
3434

3535
- *needsFetch* - Allows you to force a fetch request
3636
- *ensureKeys* - Ensures any stored data has all the required data, if not an API request will be made
3737

38-
The `callback` function will be called with an `error` and `results` from the fetch. The `error` argument will contain any errors when fetching data. The `results` argument is an object of results from the API requests. Each key is defined in the `fetchSpec` where the value is the response from the API. For an example of what a callback function might look like, check out the [Contoller](/controller) documentation.
38+
The `callback` function will be called with an `error` and `results` from the fetch. For an example callback function, check out the [Controller](/controller) documentation.
3939

40-
`options` *optional* Allows you to set caching information. The defaults for the options differ from client and server. By default API responses are not written or read from the cache on the server, but both are true on the client.
40+
`options` *optional* Allows you to set caching information. The defaults differ between client and server: by default API responses are not written or read from the cache on the server, but both are true on the client.
4141

4242
Example `options`:
4343

@@ -50,4 +50,4 @@ var opts = {
5050
Fetcher.fetch(fetchSpec, opts, callback);
5151
```
5252

53-
The `fetch` function will make an AJAX request if `readFromCache` is false **or** if the data does not exist in the store. By default on the client, the fetch request will check the corresponding store to see if the data exists, if it does no request is made and it simply returns the value in the store. If the data isn't found it generates AJAX requests for each item defined in the `fetchSpec`. **Note**: These AJAX requests are run in parallel.
53+
The `fetch` function will make an AJAX request if `readFromCache` is false **or** if the data does not exist in the ModelStore or CollectionStore. If the data isn't found in the relevant store, it makes AJAX requests for each item defined in the `fetchSpec`. **Note**: These AJAX requests are run in parallel.

_fetcher/fetchFromApi.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ header: fetchFromApi
33
example: Fetcher.fetchFromApi(spec, options, callback)
44
---
55

6-
Calls fetch for the [model](http://backbonejs.org#Model-fetch) or [collection](http://backbonejs.org#Collection-fetch) with the given options and invokes the callback when the fetch is completed.
6+
Calls `fetch` for the [model](http://backbonejs.org#Model-fetch) or [collection](http://backbonejs.org#Collection-fetch) with the given options and invokes the callback after the fetch is completed.
77

_fetcher/hydrate.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ Arguments:
99

1010
- `summaries` can be generated by the [Fetcher.summarize](#summarize) function.
1111
- `options` *optional* can be used to pass an instance of the [app](/app).
12-
- `callback` callback function, what you want to invoke after the data is retrieved from the store.
12+
- `callback` this function is invoked after the data is retrieved from the store.
1313

1414
This function is used when [attaching the child views](/view#attachChildViews).

_fetcher/pendingFetches.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ header: pendingFetches
33
example: Fetcher.pendingFetches
44
---
55

6-
Is a counter to the number of items currently being fetched. The [fetch](#fetch) function keeps track of the number of pending fetches.
6+
A counter for the number of items currently being fetched. The [fetch](#fetch) function keeps track of the number of pending fetches.

_fetcher/storeResults.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ header: storeResults
33
example: Fetcher.storeResults(results)
44
---
55

6-
Stores each of the items in the `results` object to the corresponding store.
6+
Saves each item from the `results` object into the corresponding store.

fetcher/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "Fetcher - RendrJS"
55

66
# Fetcher
77

8-
The Fetcher is initialized during the [app](/app) initialization. The class is designed to fetch data from an API on the client or server. It is attached to the app object and initializes the [Model Store](/model-store) and the [Collection Store](/collection-store). It also mixes in the [Backbone.Events](http://backbonejs.org#Events) to allow you to trigger the events on client or server the same way you would in Backbone.
8+
The Fetcher is initialized during the [app](/app) initialization and is attached to the app object. This class is designed to fetch data from an API on the client or server. It initializes the [Model Store](/model-store) and [Collection Store](/collection-store), and mixes in the [Backbone.Events](http://backbonejs.org#Events) to allow you to trigger events on client or server the way you would in Backbone.
99

1010
{% include pageDoc.html name="fetcher" %}
1111

model/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ title: "Model - RendrJS"
77

88
Rendr models extend [Backbone Models](http://backbonejs.org#Model). They are configured to run on the client and server, though some of the functionality works a little different between the two. You won't normally need to worry about these differences in your project.
99

10-
The model also mixes-in the **[syncer](/syncer)** functionality for fetching data from an API on the client or the server.
10+
The model also mixes in the **[syncer](/syncer)** functionality for fetching data from an API on the client or the server.
1111

1212
{% include pageDoc.html name="model" %}

0 commit comments

Comments
 (0)