Update README
This commit is contained in:
parent
53eb8e15aa
commit
fe1d881412
27
README.md
27
README.md
@ -10,28 +10,27 @@
|
|||||||
> Easily update nested frozen objects and arrays in a declarative and immutable
|
> Easily update nested frozen objects and arrays in a declarative and immutable
|
||||||
> manner.
|
> manner.
|
||||||
|
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
**NOTE: Before updeep is 1.0, method names or semantics may change without a major version bump, but only if really necessary.**
|
updeep makes updating deeply nested objects/arrays painless by allowing you to
|
||||||
|
declare the updates you would like to make and it will take care of the rest. It
|
||||||
|
will recursively return the same instance if no changes have been made, making
|
||||||
|
it ideal for using reference equality checks to detect changes (like
|
||||||
|
[PureRenderMixin]).
|
||||||
|
|
||||||
Updating deeply nested objects/arrays is a bit of a pain.
|
Because of this, everything returned by updeep is frozen. updeep requires
|
||||||
updeep makes it painless by allowing you to declare the updates you would like
|
[lodash], but works very well with [lodash-fp] or [Ramda]. As a matter of fact,
|
||||||
to make and it will take care of the rest.
|
many of the helpers functions are [curried][currying] [lodash] functions with
|
||||||
It will recursively return the same instance if no changes have been made,
|
their parameters reversed (like [lodash-fp]).
|
||||||
making it ideal for using reference equality checks to detect changes (like
|
|
||||||
[PureRenderMixin]). Because of this, everything returned by updeep is frozen.
|
|
||||||
|
|
||||||
updeep requires [lodash], but works very well with [lodash-fp] or [Ramda]. As a
|
Note that the parameters may be backwards from what you may be used to. updeep
|
||||||
matter of fact, many of the helpers functions are [curried][currying] [lodash]
|
|
||||||
functions with their parameters reversed (as [lodash-fp] do).
|
|
||||||
|
|
||||||
Note that the parameters may be backwards from what you are used to. updeep
|
|
||||||
supports [partial application][currying], so the parameter order is:
|
supports [partial application][currying], so the parameter order is:
|
||||||
`updeep(updates, object)`.
|
`updeep(updates, object)`.
|
||||||
|
|
||||||
## API and Examples
|
## API and Examples
|
||||||
|
|
||||||
|
**NOTE: Before updeep is 1.0, method names or semantics may change with a minor version bump.**
|
||||||
|
|
||||||
### Full example
|
### Full example
|
||||||
```js
|
```js
|
||||||
var u = require('updeep');
|
var u = require('updeep');
|
||||||
@ -189,7 +188,7 @@ expect(result).toEqual({ bunny: { color: 'brown' } });
|
|||||||
```js
|
```js
|
||||||
var result = u.updateIn('0.1.color', 'brown', [[{ color: 'blue' }, { color: 'red' }], []]);
|
var result = u.updateIn('0.1.color', 'brown', [[{ color: 'blue' }, { color: 'red' }], []]);
|
||||||
|
|
||||||
expect(result).toEqual( [[{ color: 'blue' }, { color: 'brown' }], []]);
|
expect(result).toEqual( [[{ color: 'blue' }, { color: 'brown' }], []]);
|
||||||
```
|
```
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
Loading…
Reference in New Issue
Block a user