README is clarified

This commit is contained in:
Aaron Jensen 2021-08-10 11:03:26 -04:00
parent dd641cb0b7
commit 4b5032e101
No known key found for this signature in database
GPG Key ID: C7481C94F4CA86A7

View File

@ -179,8 +179,8 @@ const result = u({ todos: addTodo }, state);
expect(result).to.eql({ todos: [{ done: false }, { done: false }, { done: false }]}); expect(result).to.eql({ todos: [{ done: false }, { done: false }, { done: false }]});
``` ```
[lodash/fp](https://github.com/lodash/lodash/wiki/FP-Guide) is one of the many [lodash/fp] is one of the many libraries providing good utility functions for
libraries providing good utility functions for such manipulations. such manipulations.
```js ```js
import fp from 'lodash/fp'; import fp from 'lodash/fp';
@ -194,9 +194,11 @@ let state = {
// add a new todo // add a new todo
state = u({ todos: fp.concat({ done: false }) }, state); state = u({ todos: fp.concat({ done: false }) }, state);
expect(state).to.eql({ todos: [{ done: true }, { done: false }, { done: false }]});
// remove all done todos // remove all done todos
state = u({ todos: fp.reject({ done: true }) }, state); state = u({ todos: fp.reject({ done: true }) }, state);
expect(state).to.eql({ todos: [{ done: false }, { done: false }]});
``` ```
#### When null or undefined object, updeep uses a default object #### When null or undefined object, updeep uses a default object