Skip to content

Commit 465530b

Browse files
refactor(overmind-vue): avoid creating new callback for mounted when no mounted
1 parent ff82571 commit 465530b

File tree

1 file changed

+4
-4
lines changed
  • packages/node_modules/overmind-vue/src

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ export default class VueApp<
9696
// a callback that runs whenever a mutation
9797
// matches the paths tracked on this component
9898
componentOptions.mounted = function() {
99-
const vueInstance = this
100-
const paths = instance.clearTrackState(this.__trackId, () => {
101-
mounted && mounted.call(vueInstance)
102-
})
99+
const paths = instance.clearTrackState(
100+
this.__trackId,
101+
mounted && mounted.bind(this)
102+
)
103103
instance.eventHub.emitAsync(EventType.COMPONENT_ADD, {
104104
componentId,
105105
componentInstanceId: this.__componentInstanceId,

0 commit comments

Comments
 (0)