Update readme and changelog
This commit is contained in:
parent
772e92789b
commit
1870f8d19b
10
CHANGELOG.md
10
CHANGELOG.md
@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
## [unreleased]
|
## [unreleased]
|
||||||
|
|
||||||
|
## [0.2.0]
|
||||||
|
* Freeze objects returned by default. It doesn't actually make sense to return
|
||||||
|
unfrozen objects, as the original object could be mutated and it would
|
||||||
|
affect the new object. Object freezing is disabled if `NODE_ENV` is
|
||||||
|
`"production'`.
|
||||||
|
* Update README with example for `reject`.
|
||||||
|
|
||||||
## [0.1.3]
|
## [0.1.3]
|
||||||
* Update README
|
* Update README
|
||||||
|
|
||||||
@ -14,7 +21,8 @@
|
|||||||
## 0.1.0
|
## 0.1.0
|
||||||
* Initial release
|
* Initial release
|
||||||
|
|
||||||
[unreleased]: https://github.com/aaronjensen/updeep/compare/v0.1.3...HEAD
|
[unreleased]: https://github.com/aaronjensen/updeep/compare/v0.2.0...HEAD
|
||||||
|
[0.2.0]: https://github.com/aaronjensen/updeep/compare/v0.1.3...v0.2.0
|
||||||
[0.1.3]: https://github.com/aaronjensen/updeep/compare/v0.1.2...v0.1.3
|
[0.1.3]: https://github.com/aaronjensen/updeep/compare/v0.1.2...v0.1.3
|
||||||
[0.1.2]: https://github.com/aaronjensen/updeep/compare/v0.1.1...v0.1.2
|
[0.1.2]: https://github.com/aaronjensen/updeep/compare/v0.1.1...v0.1.2
|
||||||
[0.1.1]: https://github.com/aaronjensen/updeep/compare/v0.1.0...v0.1.1
|
[0.1.1]: https://github.com/aaronjensen/updeep/compare/v0.1.0...v0.1.1
|
||||||
|
19
README.md
19
README.md
@ -74,7 +74,7 @@ u({ x: { b: 3 }, y: { 1: 4 } }, { x: { a: 0, b: 0 }, y: [0, 0] });
|
|||||||
### Use a function
|
### Use a function
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var inc = function(i) { return i + 1; }
|
function inc(i) { return i + 1; }
|
||||||
u({ x: { b: inc } }, { x: { a: 0, b: 0 } });
|
u({ x: { b: inc } }, { x: { a: 0, b: 0 } });
|
||||||
// => { x: { a: 0, b: 1 } }
|
// => { x: { a: 0, b: 1 } }
|
||||||
```
|
```
|
||||||
@ -94,6 +94,14 @@ u({ x: u.omit('b') }, { x: { a: 0, b: 0 } });
|
|||||||
// => { x: { a: 0 } }
|
// => { x: { a: 0 } }
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Reject an item from an array
|
||||||
|
|
||||||
|
```js
|
||||||
|
function even(i) { return i % 2 === 0 };
|
||||||
|
u({ x: u.reject(even) }, { x: [1, 2, 3, 4] });
|
||||||
|
// => { x: [1, 3] }
|
||||||
|
```
|
||||||
|
|
||||||
### With a default
|
### With a default
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@ -120,6 +128,11 @@ $ npm install --save updeep
|
|||||||
Requires [lodash] as a peer dependency, so make sure you have it installed as
|
Requires [lodash] as a peer dependency, so make sure you have it installed as
|
||||||
well.
|
well.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
If `NODE_ENV` is `"production"`, updeep will not attempt to freeze objects.
|
||||||
|
This may yield a slight performance gain.
|
||||||
|
|
||||||
## Motivation
|
## Motivation
|
||||||
|
|
||||||
While creating reducers for use with [redux], I wanted something that made it
|
While creating reducers for use with [redux], I wanted something that made it
|
||||||
@ -128,6 +141,10 @@ advantages over things like [Immutable.js][immutablejs] such as debugging and
|
|||||||
destructuring. I wanted something more powerful than [icepick] and more
|
destructuring. I wanted something more powerful than [icepick] and more
|
||||||
composable than [React.addons.update].
|
composable than [React.addons.update].
|
||||||
|
|
||||||
|
If you're manipulating massive amounts of data frequently, you may want to
|
||||||
|
benchmark, as [Immutable.js][immutablejs] should be more efficient in that
|
||||||
|
case.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
1. Fork it.
|
1. Fork it.
|
||||||
|
Loading…
Reference in New Issue
Block a user