Update readme and changelog

main
Aaron Jensen 2015-08-02 00:42:02 -07:00
parent 772e92789b
commit 1870f8d19b
2 changed files with 27 additions and 2 deletions

View File

@ -2,6 +2,13 @@
## [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]
* Update README
@ -14,7 +21,8 @@
## 0.1.0
* 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.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

View File

@ -74,7 +74,7 @@ u({ x: { b: 3 }, y: { 1: 4 } }, { x: { a: 0, b: 0 }, y: [0, 0] });
### Use a function
```js
var inc = function(i) { return i + 1; }
function inc(i) { return i + 1; }
u({ x: { b: inc } }, { x: { a: 0, b: 0 } });
// => { x: { a: 0, b: 1 } }
```
@ -94,6 +94,14 @@ u({ x: u.omit('b') }, { x: { a: 0, b: 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
```js
@ -120,6 +128,11 @@ $ npm install --save updeep
Requires [lodash] as a peer dependency, so make sure you have it installed as
well.
## Configuration
If `NODE_ENV` is `"production"`, updeep will not attempt to freeze objects.
This may yield a slight performance gain.
## Motivation
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
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
1. Fork it.