Skip to content

Instantly share code, notes, and snippets.

@jorroll
Created November 4, 2019 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jorroll/0273b209c801e740878cca73dab24427 to your computer and use it in GitHub Desktop.
Save jorroll/0273b209c801e740878cca73dab24427 to your computer and use it in GitHub Desktop.
class FormControl<Value = any, Data = any>
implements AbstractControl<Value, Data> {
id: ControlId;
markTouched(value: boolean, options: ControlEventOptions = {}) {
if (value !== this._touched) {
this.source.next({
source: options.source || this.id,
processed: [],
type: 'StateChange',
changes: new Map([['touched', value]]),
noEmit: options.noEmit,
meta: options.meta,
});
}
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment