proxy-state-tree
Advanced tools
Comparing version
{ | ||
"name": "proxy-state-tree", | ||
"version": "6.3.1-1745235280800", | ||
"version": "6.3.1-1745330394942", | ||
"description": "An implementation of the Mobx/Vue state tracking approach, for library authors", | ||
@@ -40,6 +40,6 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@size-limit/file": "^11.1.6", | ||
"size-limit": "^11.1.6", | ||
"terser-webpack-plugin": "^5.3.11", | ||
"webpack": "^5.98.0" | ||
"@size-limit/file": "^11.2.0", | ||
"size-limit": "^11.2.0", | ||
"terser-webpack-plugin": "^5.3.14", | ||
"webpack": "^5.99.6" | ||
}, | ||
@@ -46,0 +46,0 @@ "size-limit": [ |
@@ -18,3 +18,3 @@ # proxy-state-tree | ||
```js | ||
import { ProxyStateTree } from 'proxy-state-tree' | ||
import { ProxyStateTree } from 'proxy-state-tree' | ||
@@ -78,3 +78,6 @@ const initialState = {} | ||
const movedProxy = tree.rescope(trackStateTreeA.state.someObjectOrArray, trackStateTreeB) | ||
const movedProxy = tree.rescope( | ||
trackStateTreeA.state.someObjectOrArray, | ||
trackStateTreeB | ||
) | ||
``` | ||
@@ -97,7 +100,10 @@ | ||
trackStateTree.trackScope((tree) => { | ||
// Some logic accessing the state of the tree | ||
}, () => { | ||
// Notifies about changes | ||
}) | ||
trackStateTree.trackScope( | ||
(tree) => { | ||
// Some logic accessing the state of the tree | ||
}, | ||
() => { | ||
// Notifies about changes | ||
} | ||
) | ||
``` | ||
@@ -124,3 +130,3 @@ | ||
mutationTree.state.foo = "bar" | ||
mutationTree.state.foo = 'bar' | ||
``` | ||
@@ -163,3 +169,3 @@ | ||
mutationTree.state.foo = "bar2" | ||
mutationTree.state.foo = 'bar2' | ||
@@ -182,4 +188,4 @@ mutationTree.flush() | ||
mutationTree.state.foo = "bar2" | ||
mutationTree2.state.bar = "baz2" | ||
mutationTree.state.foo = 'bar2' | ||
mutationTree2.state.bar = 'baz2' | ||
@@ -189,3 +195,3 @@ tree.flush([mutationTree, mutationTree2]) | ||
A flush returns what mutations has been flushed out, also with a *flushId*. | ||
A flush returns what mutations has been flushed out, also with a _flushId_. | ||
@@ -237,6 +243,6 @@ ## onMutation | ||
When running in development all **TrackStateTree** forks has the same *proxifier*, meaning they share proxies. They can do this cause the trees "hand over" tracking to each other. | ||
When running in development all **TrackStateTree** forks has the same _proxifier_, meaning they share proxies. They can do this cause the trees "hand over" tracking to each other. | ||
Every fork of a **MutationTree** has its own *proxifier*. The reason for this is that in development each mutation tree fork should live on its own for tracking purposes. | ||
Every fork of a **MutationTree** has its own _proxifier_. The reason for this is that in development each mutation tree fork should live on its own for tracking purposes. | ||
When running in production there is only one *proxifier* shared among all trees, and there is only one mutationtree instance as tracking is no longer needed. | ||
When running in production there is only one _proxifier_ shared among all trees, and there is only one mutationtree instance as tracking is no longer needed. |
183736
0.01%241
2.55%