File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
packages/node_modules/overmind-svelte/src Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,16 @@ export function createMixin (overmind) {
1515 const componentInstanceId = nextComponentInstanceId ++
1616 let isUpdating = false
1717
18- tree . track ( ( mutations , paths , flushId ) => {
18+ const onUpdate = ( mutations , paths , flushId ) => {
19+ tree . track ( onUpdate )
1920 currentFlushId = flushId
2021 isUpdating = true
21- listener ( tree )
22- } )
22+ listener ( tree . state )
23+ }
24+
25+ tree . track ( onUpdate )
2326
24- listener ( tree )
27+ listener ( tree . state )
2528
2629 if ( IS_PRODUCTION ) {
2730 afterUpdate ( ( ) => {
@@ -54,7 +57,6 @@ export function createMixin (overmind) {
5457 }
5558
5659 return ( ) => {
57- tree . stopTracking ( )
5860 overmind . proxyStateTree . disposeTree ( tree )
5961 overmind . eventHub . emitAsync ( EventType . COMPONENT_REMOVE , {
6062 componentId,
@@ -73,8 +75,7 @@ export function createMixin (overmind) {
7375 }
7476
7577 return {
76- subscribe,
77- state : overmind . state ,
78+ state : { ...overmind . state , subscribe} ,
7879 actions : overmind . actions ,
7980 effects : overmind . effects ,
8081 addMutationListener : overmind . addMutationListener ,
You can’t perform that action at this time.
0 commit comments