Added enqueueUpdate to Kopytko component to reduce the number of rerenders needed. Calling forceUpdate in a row would trigger multiple DOM updates. Thanks to the new function DOM will be updated only once in the next tick.
How did you implement it:
enqueueUpdate calls KopytkoUpdater.enqueueStateUpdatewith empty partialState and it behaves the same as setState function but m.state is not updated and no extra callbacks are triggered.
How can we verify it:
Create component outside of the Kopytko as in example in renderer.md, section Force update and enqueue update methods, and use setFields({...}) to update multiple fields at once. render function should be executed only once.
Todos:
[X] Write documentation (if required)
[X] Fix linting errors
[X] Enable "Allow edits from maintainers" for this PR
[X] Update the messages below
Is this ready for review?: YES
Is it a breaking change?: NO
What did you implement:
Added
enqueueUpdate
toKopytko
component to reduce the number of rerenders needed. CallingforceUpdate
in a row would trigger multiple DOM updates. Thanks to the new function DOM will be updated only once in the next tick.How did you implement it:
enqueueUpdate
callsKopytkoUpdater.enqueueStateUpdate
with emptypartialState
and it behaves the same assetState
function butm.state
is not updated and no extra callbacks are triggered.How can we verify it:
Create component outside of the
Kopytko
as in example inrenderer.md
, sectionForce update and enqueue update methods
, and usesetFields({...})
to update multiple fields at once.render
function should be executed only once.Todos:
Is this ready for review?: YES Is it a breaking change?: NO