Skip to content

Commit 84fdb00

Browse files
feat(proxy-state-tree): removed set functions, now everything is derived, also set functions
1 parent 740dec2 commit 84fdb00

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

packages/node_modules/proxy-state-tree/src/index.test.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -705,17 +705,6 @@ describe('FUNCTIONS', () => {
705705
expect(accessTree.state.foo).toBe('bar')
706706
})
707707

708-
test('should be able to set functions acting as plain value functions', () => {
709-
const tree = new ProxyStateTree({
710-
foo: null,
711-
})
712-
const mutationTree = tree.getMutationTree()
713-
714-
mutationTree.state.foo = () => 'bar'
715-
716-
expect(mutationTree.state.foo()).toBe('bar')
717-
})
718-
719708
test('should pass proxy-state-tree instance and path', () => {
720709
const state = {
721710
foo: (proxyStateTree, path) => {
@@ -742,8 +731,8 @@ describe('FUNCTIONS', () => {
742731
},
743732
}
744733
const tree = new ProxyStateTree(state, {
745-
dynamicWrapper: (proxyStateTree, path, func) =>
746-
func('foo', proxyStateTree, path),
734+
onFunction: (proxyStateTree, path, func) =>
735+
({ func, value: func('foo', proxyStateTree, path)}),
747736
})
748737

749738
const accessTree = tree.getTrackStateTree().track(() => {})

0 commit comments

Comments
 (0)