Skip to content

Stable Reference Event Handler Callback #14

@aminnairi

Description

@aminnairi

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions