Skip to content

Commit debd4b1

Browse files
feat(overmind-vue): conform to new typing and API
BREAKING CHANGE: requires new Overmind version with new typing
1 parent a752be2 commit debd4b1

File tree

1 file changed

+7
-6
lines changed
  • packages/node_modules/overmind-vue/src

1 file changed

+7
-6
lines changed

packages/node_modules/overmind-vue/src/index.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import {
22
ENVIRONMENT,
33
EventType,
44
IConfiguration,
5+
IContext,
56
MODE_SSR,
67
Overmind,
78
} from 'overmind'
@@ -40,7 +41,7 @@ function createMixin(overmind, propsCallback, trackPropsCallback = false) {
4041
}
4142
} else {
4243
this[OVERMIND] = {
43-
tree: (overmind as any).proxyStateTree.getTrackStateTree(),
44+
tree: (overmind as any).proxyStateTreeInstance.getTrackStateTree(),
4445
componentInstanceId: componentInstanceId++,
4546
onUpdate: (mutations, paths, flushId) => {
4647
this[OVERMIND].currentFlushId = flushId
@@ -125,7 +126,7 @@ function createMixin(overmind, propsCallback, trackPropsCallback = false) {
125126
if (overmind.mode.mode === MODE_SSR) return
126127

127128
// @ts-ignore
128-
overmind.proxyStateTree.disposeTree(this[OVERMIND].tree)
129+
overmind.proxyStateTreeInstance.disposeTree(this[OVERMIND].tree)
129130
if (IS_PRODUCTION) {
130131
return
131132
}
@@ -152,11 +153,11 @@ export const createPlugin = (overmind) => ({
152153
},
153154
})
154155

155-
export function createConnect<Config extends IConfiguration>(
156-
overmind: Overmind<Config>
156+
export function createConnect<Context extends IContext<any>>(
157+
overmind: Overmind<any>
157158
) {
158-
return <T extends {}>(
159-
cb: ((overmind: Overmind<Config>) => T) | AnyComponent,
159+
return <T>(
160+
cb: ((context: Context) => T) | AnyComponent,
160161
component?: AnyComponent
161162
) => {
162163
let options: any = component || cb

0 commit comments

Comments
 (0)