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

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Aug 24, 2015
1 parent ffb93a6 commit ab7777a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ Kudos to Jing Chen for suggesting this approach.

### Sample App

#### Flux

See **[flux-react-router-example](https://github.com/gaearon/flux-react-router-example)**.

#### Redux

See **[redux/examples/real-world](https://github.com/rackt/redux/tree/master/examples/real-world)**.

### The Problem

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

####`normalize(obj, schema)`
####`normalize(obj, schema, [options])`

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

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.


```javascript
const article = new Schema('articles');
Expand Down

0 comments on commit ab7777a

Please sign in to comment.