Skip to content

Commit 60dc73d

Browse files
fix(overmind-angular): comment out angular temp and fix react
1 parent 0279754 commit 60dc73d

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type TConnect<Config extends Configuration> = {
1111
}
1212

1313
let nextComponentId = 0
14-
14+
/*
1515
export const createConnect = <A extends Overmind<any>>(overmind: A) => () => {
1616
const componentId = nextComponentId++
1717
let componentInstanceId = 0
@@ -29,7 +29,7 @@ export const createConnect = <A extends Overmind<any>>(overmind: A) => () => {
2929
actions: overmind.actions,
3030
}
3131
this.__componentInstanceId = componentInstanceId++
32-
this.__shouldUpdatePaths = false
32+
this.__tree = false
3333
this.__currentTrackId = null
3434
this.__listener = null
3535
@@ -129,3 +129,4 @@ export const createConnect = <A extends Overmind<any>>(overmind: A) => () => {
129129
return target
130130
}
131131
}
132+
*/

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,9 @@ export const createConnect = <A extends Overmind<Configuration>>(
134134
if (isClassComponent) {
135135
const originalRender = component.prototype.render
136136
component.prototype.render = function() {
137-
this.tree.track(this.props.overmind.onUpdate)
138-
return originalRender()
137+
this.props.overmind &&
138+
this.props.overmind.tree.track(this.props.overmind.onUpdate)
139+
return originalRender.call(this)
139140
}
140141
}
141142

@@ -180,6 +181,7 @@ export const createConnect = <A extends Overmind<Configuration>>(
180181
state: this.tree.state,
181182
actions: overmind.actions,
182183
onUpdate: this.onUpdate,
184+
tree: this.tree,
183185
},
184186
} as any)
185187
}

0 commit comments

Comments
 (0)