From b9571bc8fce009fbc9b7b9e2782de6d98ee76b18 Mon Sep 17 00:00:00 2001 From: Anson Kao Date: Tue, 26 Jan 2016 17:47:17 -0500 Subject: [PATCH] Documented u.freeze --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index d9b8aaa..69430bb 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,15 @@ var result = u({ person: { [key]: 21 } }, { person: { name: 'Olivier P.', age: 2 expect(result).to.eql({ person: { name: 'Olivier P.', age: 21 } }); ``` +### `u.freeze` + +Freeze your initial state to protect against mutations. Does nothing in production. + +```js +var state = u.freeze({someKey: "Some Value"}) +state.someKey = "Mutate" // ERROR in development +``` + ### `u._` All updeep functions are curried.