Browse Source

Add emitUpdate

pull/5270/head
Artur Arseniev 3 years ago
parent
commit
83ce74d54f
  1. 10
      src/trait_manager/model/Trait.ts

10
src/trait_manager/model/Trait.ts

@ -53,7 +53,14 @@ export interface TraitProperties {
text?: string; text?: string;
full?: boolean; full?: boolean;
getValue?: (props: { editor: Editor; trait: Trait; component: Component }) => any; getValue?: (props: { editor: Editor; trait: Trait; component: Component }) => any;
setValue?: (props: { value: any; editor: Editor; trait: Trait; component: Component; partial: boolean }) => void; setValue?: (props: {
value: any;
editor: Editor;
trait: Trait;
component: Component;
partial: boolean;
emitUpdate: () => void;
}) => void;
} }
type TraitOption = { type TraitOption = {
@ -177,6 +184,7 @@ export default class Trait extends Model<TraitProperties> {
trait: this, trait: this,
component: this.target, component: this.target,
partial: !!opts.partial, partial: !!opts.partial,
emitUpdate: () => this.targetUpdated(),
}); });
return; return;
} }

Loading…
Cancel
Save