Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/leoasis/stillness
Immutable manipulation helpers to aid in nested state updates
https://github.com/leoasis/stillness
Last synced: about 1 month ago
JSON representation
Immutable manipulation helpers to aid in nested state updates
- Host: GitHub
- URL: https://github.com/leoasis/stillness
- Owner: leoasis
- License: mit
- Created: 2015-08-27T20:52:01.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-27T20:52:15.000Z (over 9 years ago)
- Last Synced: 2024-10-21T17:56:54.691Z (2 months ago)
- Language: JavaScript
- Size: 105 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# stillness
Immutable manipulation helpers to aid in nested state updates. Inspired by the [Immutable.js](https://github.com/facebook/immutable-js) API.
## Why?
Explain pain of doing nested updates
## How to install
```
npm install --save stillness
```## How to use
```js
var stillness = require('stillness');var blog = {
title: 'The super interesting blog',
posts: [
{ title: "10 reasons you shouldn't use A", content: "..." },
{ title: "B considered harmful", content: "..." },
{ title: "Learn C in 30 seconds with this one weird trick", content: "..." },
]
};// getIn(path: [string | number], obj: object) : any
getIn(['title'], blog); // => 'The super interesting blog'
getIn(['posts', 0, 'title']) // => "10 reasons you shouldn't use A"```