-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Is your feature request related to a problem? Please describe.
As for React, this library uses a virtual DOM, which computes the new virtual DOM based on the current page definition, which invokes every components in its way.
Each time a state is updated, all callbacks that are defined inside the page are assigned a new reference, which can be costy at runtime for some complex applications, or on low-end devices.
This is the same problem as in React, but this is also the only way to have a pure function computing the application's next view.
Describe the solution you'd like
Create an equivalent useCallback function that would memoize & stabilize the callback's reference, until one of its dependencies is changed.
Describe alternatives you've considered
None.
Additional context
This would not introduce any breaking changes.