Skip to content

Commit

Permalink
feat(overmind-vue): conform to new typing and API
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
requires new Overmind version with new typing
  • Loading branch information
christianalfoni committed Jan 23, 2021
1 parent a752be2 commit debd4b1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/node_modules/overmind-vue/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
ENVIRONMENT,
EventType,
IConfiguration,
IContext,
MODE_SSR,
Overmind,
} from 'overmind'
Expand Down Expand Up @@ -40,7 +41,7 @@ function createMixin(overmind, propsCallback, trackPropsCallback = false) {
}
} else {
this[OVERMIND] = {
tree: (overmind as any).proxyStateTree.getTrackStateTree(),
tree: (overmind as any).proxyStateTreeInstance.getTrackStateTree(),
componentInstanceId: componentInstanceId++,
onUpdate: (mutations, paths, flushId) => {
this[OVERMIND].currentFlushId = flushId
Expand Down Expand Up @@ -125,7 +126,7 @@ function createMixin(overmind, propsCallback, trackPropsCallback = false) {
if (overmind.mode.mode === MODE_SSR) return

// @ts-ignore
overmind.proxyStateTree.disposeTree(this[OVERMIND].tree)
overmind.proxyStateTreeInstance.disposeTree(this[OVERMIND].tree)
if (IS_PRODUCTION) {
return
}
Expand All @@ -152,11 +153,11 @@ export const createPlugin = (overmind) => ({
},
})

export function createConnect<Config extends IConfiguration>(
overmind: Overmind<Config>
export function createConnect<Context extends IContext<any>>(
overmind: Overmind<any>
) {
return <T extends {}>(
cb: ((overmind: Overmind<Config>) => T) | AnyComponent,
return <T>(
cb: ((context: Context) => T) | AnyComponent,
component?: AnyComponent
) => {
let options: any = component || cb
Expand Down

0 comments on commit debd4b1

Please sign in to comment.