Skip to content
This repository was archived by the owner on Mar 20, 2022. It is now read-only.

Commit ab7777a

Browse files
committed
Update README.md
1 parent ffb93a6 commit ab7777a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ Kudos to Jing Chen for suggesting this approach.
66

77
### Sample App
88

9+
#### Flux
10+
911
See **[flux-react-router-example](https://github.com/gaearon/flux-react-router-example)**.
1012

13+
#### Redux
14+
15+
See **[redux/examples/real-world](https://github.com/rackt/redux/tree/master/examples/real-world)**.
16+
1117
### The Problem
1218

1319
* You have a JSON API that returns deeply nested objects;
@@ -255,11 +261,13 @@ article.define({
255261
});
256262
```
257263

258-
####`normalize(obj, schema)`
264+
####`normalize(obj, schema, [options])`
259265

260266
Normalizes object according to schema.
261267
Passed `schema` should be a nested object reflecting the structure of API response.
262268

269+
You may optionally specify a custom `assignEntity` function in `options`. This is useful if your backend emits additional fields, such as separate ID fields, you'd like to delete in the normalized entity. See [the test](https://github.com/babsonmatt/normalizr/blob/de08c29bc03120bf9fc2964041f46ad3950d01af/test/index.js#L80-L126) and the [discussion](https://github.com/gaearon/normalizr/issues/10) for a usage example.
270+
263271

264272
```javascript
265273
const article = new Schema('articles');

0 commit comments

Comments
 (0)