Skip to content

Allow chain-able/async emitChange or bulk change #66

@MaurizioVacca

Description

@MaurizioVacca

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});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions