Skip to content
This repository was archived by the owner on Oct 14, 2018. It is now read-only.

Support server side rendering #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Support server side rendering #62

wants to merge 1 commit into from

Conversation

taou-maimai
Copy link

No description provided.

@dustingetz
Copy link
Owner

I think your change is safe but I need to be certain, so I need to write some tests before I merge this. The memoizer stuff is hard to reason about and there are some weird edge cases to consider, like if there are multiple react roots on the page, so the caches have to be separate.

@dustingetz
Copy link
Owner

If I went ahead and implemented #17, that would also fix your use case, right?

@taou-maimai
Copy link
Author

Even if there are multiple react roots on the page(and Cursor.build is called on each root state), the function 'memoizeFactory()' in util.js is called only once (another issue?) and only one 'cache' exists. It makes no difference moving that to package scope.

So I think you can safely merge my change as a stop-gap and pub it to npm, then I am able to use 'react-cursor' in my project without changing library name in package.json to that of my fork.

@dustingetz
Copy link
Owner

Published as 1.2.1

@taou-maimai
Copy link
Author

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants