You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The risk parameter introduces randomness into the cost calculation, which means that when risk > 0, the cost will vary on each calculation. Because we recalculate the cost on every render, we sometimes flash different results for the same combination of parameters (e.g., on screen resizing), which might be confusing without full context.
Memoizing this calculation based on the parameters should fix this and would be a nice little UI improvement!
The text was updated successfully, but these errors were encountered:
I haven't opened a PR because it's missing one last step, which is refactoring the Curve component to prevent it from firing a set dispatch on it's initial render.
Some of the refactor was to reduce the cognitive load, but the overall approach was:
Refactor Cost logic into it's own context
Reduce side-effects by moving function definitions from the FC functional scope to the module scope
Add a "pristine" ref that is checked on-load, and when true, pull calculated data from local storage
I timed-box my contribution and unfortunately got pulled into something else, so I can't dedicate anymore time to this, but I wish y'all best of luck!
The risk parameter introduces randomness into the cost calculation, which means that when risk > 0, the cost will vary on each calculation. Because we recalculate the cost on every render, we sometimes flash different results for the same combination of parameters (e.g., on screen resizing), which might be confusing without full context.
Memoizing this calculation based on the parameters should fix this and would be a nice little UI improvement!
The text was updated successfully, but these errors were encountered: