Skip to content

Commit

Permalink
fix observe wrapper, can't share symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Feb 28, 2018
1 parent 996a464 commit 48a2429
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/integration/preact.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, h } from 'preact';

import { modelSymbol, observedSymbol } from '../symbols';
import { observedSymbol } from '../symbols';

import { assign } from '../util';

Expand All @@ -11,7 +11,7 @@ export function observe(Child) {
const update = () => this.setState(EMPTY_OBJECT);
this.componentDidMount = () => {
this[observedSymbol] = Object.values(props)
.filter(prop => prop[modelSymbol])
.filter(prop => prop.__p_model && prop.onPatch)
.map(model => model.onPatch(update));
};
this.componentWillUnmount = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/integration/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function observe(Child) {
const update = () => this.setState(EMPTY_OBJECT);
this.componentDidMount = () => {
this[observedSymbol] = Object.values(props)
.filter(prop => prop[modelSymbol])
.filter(prop => prop.__p_model && prop.onPatch)
.map(model => model.onPatch(update));
};
this.componentWillUnmount = () => {
Expand Down

0 comments on commit 48a2429

Please sign in to comment.