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

Replace cacheLayout(...) with withCachedLayout(..., callback) #96

Open
david-tejada opened this issue Apr 26, 2023 · 0 comments
Open

Replace cacheLayout(...) with withCachedLayout(..., callback) #96

david-tejada opened this issue Apr 26, 2023 · 0 comments

Comments

@david-tejada
Copy link
Owner

The function cacheLayout it's used for performance reasons, to avoid reflow. The issue right now is that every time I call cacheLayout I need to remember to call clearLayoutCache afterwards so that any function that calls any of the cached layout functions doesn't get stale data.

Similarly to what I did with withStack the function withCachedLayout would handle cashing the layout values and clearing them afterwards so that I don't need to remember to clear them every time.

@david-tejada david-tejada changed the title Replace cacheLayout(..) with withCachedLayout(..., callback) Replace cacheLayout(...) with withCachedLayout(..., callback) Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant