mirror of
https://github.com/zhigang1992/update-immutable.git
synced 2026-01-12 17:53:12 +08:00
add ES5 usage
This commit is contained in:
10
README.md
10
README.md
@@ -16,6 +16,16 @@ This is a mostly-compatible re-implementation of [react's update function](https
|
||||
## next: { a: 1, b: 2 }
|
||||
## orig: { a: 1 }
|
||||
|
||||
## Usage (ES5)
|
||||
|
||||
var update = require("update-immutable").default;
|
||||
|
||||
var orig = { a: 1 };
|
||||
var next = update(orig, { b: { $set: 2 } });
|
||||
|
||||
## next: { a: 1, b: 2 }
|
||||
## orig: { a: 1 }
|
||||
|
||||
|
||||
## Features
|
||||
|
||||
|
||||
Reference in New Issue
Block a user