Skip to content

Commit

Permalink
Move away from deprecated sendAction function
Browse files Browse the repository at this point in the history
This closes bustle#160. I followed the deprecation guidelines here:
https://deprecations-app-prod.herokuapp.com/deprecations/v3.x/#toc_ember-component-send-action

However, there are various ways this could be accomplished,
so I’ll be asking for feedback in my PR.
  • Loading branch information
backspace committed Nov 7, 2018
1 parent 95e1807 commit 76ccebc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions addon/components/mobiledoc-editor/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,13 @@ export default Component.extend({
editor.destroy();
},

'on-change': () => {},

postDidChange(editor) {
let serializeVersion = this.get('serializeVersion');
let updatedMobileDoc = editor.serialize(serializeVersion);
this._localMobiledoc = updatedMobileDoc;
this.sendAction('on-change', updatedMobileDoc); // eslint-disable-line ember/closure-actions
this['on-change'](updatedMobileDoc);
},

inputModeDidChange(editor) {
Expand Down Expand Up @@ -326,12 +328,16 @@ export default Component.extend({

},

'will-create-editor': () => {},

willCreateEditor() {
this.sendAction(WILL_CREATE_EDITOR_ACTION); // eslint-disable-line ember/closure-actions
this['will-create-editor']();
},

'did-create-editor': () => {},

didCreateEditor(editor) {
this.sendAction(DID_CREATE_EDITOR_ACTION, editor); // eslint-disable-line ember/closure-actions
this['did-create-editor'](editor);
},

_addAtom(atomName, text, payload) {
Expand Down

0 comments on commit 76ccebc

Please sign in to comment.