At the current state, if you use emitChange to update the form state in quick succession, the updates enter a race condition where the last called wins. For example, given the following scenario:
emitChange('name', value);
emitChange('surname', value);
the second emitChange will override the first one, so name will be accidentally restored to the original value instead of being updated.
Possible solutions may be:
- allow to consume
emit* as a chain-able/async resource, e.g. await emitChange(fieldName, value);
- add a "bulk update" emitter that can take a part of the form as a resource, e.g.
emitBulkUpdate({key_1: value, key_2: value});
At the current state, if you use emitChange to update the form state in quick succession, the updates enter a race condition where the last called wins. For example, given the following scenario:
the second emitChange will override the first one, so
namewill be accidentally restored to the original value instead of being updated.Possible solutions may be:
emit*as a chain-able/async resource, e.g.await emitChange(fieldName, value);emitBulkUpdate({key_1: value, key_2: value});