Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Shadow type #1900

Merged
merged 1 commit into from
Nov 14, 2023
Merged

Add Shadow type #1900

merged 1 commit into from
Nov 14, 2023

Conversation

pfrazee
Copy link
Collaborator

@pfrazee pfrazee commented Nov 14, 2023

We use a "shadow cache" for profiles and posts to ensure synchronized state across views and to handle optimistic updates. As we've begun passing around the shadowed values, we noticed that it's easy to miss when a component depends on the shadowing. This is a problem because passing unshadowed posts/profiles will cause the component to break.

This PR adds a Shadow<T> type to help avoid that footgun.

Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

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

Yep, perfect

@pfrazee pfrazee merged commit 8e4a3ad into main Nov 14, 2023
1 of 2 checks passed
@pfrazee pfrazee deleted the shadow-type branch November 14, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants