Skip to content

Try to allow memoization of components with state - #348

Closed
darknoon wants to merge 1 commit into
meta:masterfrom
darknoon:memoize-state
Closed

darknoon wants to merge 1 commit into
meta:masterfrom
darknoon:memoize-state

Conversation

@darknoon

Copy link
Copy Markdown
Contributor

Work in progress, via discussions with @adamjernst. Need to clean up the id scopeIdentifier parameter, which shouldn't be necessary.

@darknoon

Copy link
Copy Markdown
Contributor Author

Related to #316.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead, use c.scopeHandle.rootIdentifier which is a unique identifier for its scope frame that persists across state updates.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should use CKAssert or whatever here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup

@adamjernst

Copy link
Copy Markdown
Contributor

Reviewing now...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already exists as scopeFrameToken, can we just use that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see why you didn't and exposed this instead. Will consider...

@adamjernst

Copy link
Copy Markdown
Contributor

Perfect, let's clean it up and land it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants