Skip to content

Commit 4a694e7

Browse files
fix(overmind-vue): move last piece of logic over
1 parent 2652aa5 commit 4a694e7

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

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

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
MODE_SSR,
66
Overmind,
77
} from 'overmind'
8-
import { Component, ComponentOptions, defineComponent, provide, h } from 'vue'
8+
import { Component, ComponentOptions } from 'vue'
99

1010
type AnyComponent = ComponentOptions | Component
1111

@@ -177,17 +177,3 @@ export function createConnect<Config extends IConfiguration>(
177177
} as any
178178
}
179179
}
180-
181-
export const withOvermind = (
182-
instance: Overmind<IConfiguration>,
183-
Component: Component
184-
) => {
185-
return defineComponent({
186-
setup() {
187-
provide('overmind', instance)
188-
},
189-
render() {
190-
return h(Component)
191-
},
192-
})
193-
}

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,30 @@ import {
1313
onRenderTracked,
1414
onMounted,
1515
onBeforeUnmount,
16+
defineComponent,
17+
provide,
18+
h,
19+
Component,
1620
} from 'vue'
1721

1822
const IS_PRODUCTION = ENVIRONMENT === 'production'
1923

2024
let nextComponentId = 0
2125

26+
export const withOvermind = (
27+
instance: Overmind<IConfiguration>,
28+
Component: Component
29+
) => {
30+
return defineComponent({
31+
setup() {
32+
provide('overmind', instance)
33+
},
34+
render() {
35+
return h(Component)
36+
},
37+
})
38+
}
39+
2240
export interface StateHook<Config extends IConfiguration> {
2341
(): Ref<Overmind<Config>['state']>
2442
<CB extends (state: Overmind<Config>['state']) => object>(

0 commit comments

Comments
 (0)