Open
Conversation
Onurbon
reviewed
Oct 4, 2019
packages/core/src/connect.tsx
Outdated
| }); | ||
|
|
||
| Object.keys(prevWatched).forEach(pathKey => { | ||
| const keyDeleted = watched.current.hasOwnProperty(pathKey); |
Member
Author
There was a problem hiding this comment.
Oh sorry, you mean negation. Good spot!
Onurbon
reviewed
Oct 4, 2019
|
|
||
| public render() { | ||
| this.createViewCtx(); | ||
| return (func as ((args: any) => (props: any) => any))(ctx)(props); |
Contributor
There was a problem hiding this comment.
I'm pretty sure this breaks support for hooks because func(ctx) will be a different function each time.
Member
Author
There was a problem hiding this comment.
We've done this before and I think it worked. Will do some testing
Collaborator
There was a problem hiding this comment.
I think hooks still work. At least the update-testing example works as expected.
Member
Author
|
Looks like this breaks the dev tools though - looking now but please don't merge. |
coffee-cup
reviewed
Oct 7, 2019
| logger.debug("store", store); | ||
| }, []); | ||
|
|
||
| const pathNodes = React.useRef({}); |
Comment on lines
+5
to
+7
| // const getValue = (path: string[], obj: any): any => | ||
| // path.reduce((x: any, y: any) => x && x[y], obj); | ||
|
|
Comment on lines
+40
to
+44
|
|
||
| // if (seenValue !== getValue(path, store.universe)) { | ||
| // console.log(`Not seen ${path} before, so rerendering`); | ||
| // node.forceUpdate(); | ||
| // } |
|
|
||
| return true; | ||
| }; | ||
| const getValue = (path: string[], obj: any): any => |
Collaborator
There was a problem hiding this comment.
This is the same as the get function in watch.ts. Maybe extract so its only defined once.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please test before merging - particularly when importing
@prodo/corefrom outside of the monorepo.