fix: editor status after changing note

This commit is contained in:
Mo Bitar
2020-04-24 12:55:23 -05:00
parent fa831f775b
commit dee164f4a2
9 changed files with 85 additions and 68 deletions

View File

@@ -75,10 +75,10 @@ export class Editor {
/**
* Register to be notified when the editor's note changes.
*/
public onNoteChange(onNoteChange: () => void) {
this._onNoteChange = onNoteChange;
public onNoteChange(callback: () => void) {
this._onNoteChange = callback;
if (this.note) {
onNoteChange();
callback();
}
}
@@ -86,10 +86,8 @@ export class Editor {
* Register to be notified when the editor's note's values change
* (and thus a new object reference is created)
*/
public onNoteValueChange(
onNoteValueChange: (note: SNNote, source?: PayloadSource) => void
) {
this._onNoteValueChange = onNoteValueChange;
public onNoteValueChange(callback: (note: SNNote, source?: PayloadSource) => void) {
this._onNoteValueChange = callback;
}
/**