diff --git a/packages/ember-metal/lib/observer.js b/packages/ember-metal/lib/observer.js index 6fa852133f1..530368c9ed7 100644 --- a/packages/ember-metal/lib/observer.js +++ b/packages/ember-metal/lib/observer.js @@ -16,11 +16,11 @@ import { const AFTER_OBSERVERS = ':change'; const BEFORE_OBSERVERS = ':before'; -function changeEvent(keyName) { +export function changeEvent(keyName) { return keyName + AFTER_OBSERVERS; } -function beforeEvent(keyName) { +export function beforeEvent(keyName) { return keyName + BEFORE_OBSERVERS; } diff --git a/packages/ember-metal/lib/property_events.js b/packages/ember-metal/lib/property_events.js index f58daa8b7f8..6a9b7efdc8a 100644 --- a/packages/ember-metal/lib/property_events.js +++ b/packages/ember-metal/lib/property_events.js @@ -13,6 +13,7 @@ import { EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER, } from 'ember/features'; import { assertNotRendered } from './transaction'; +import { changeEvent, beforeEvent } from './observer'; /** @module ember @@ -283,7 +284,7 @@ function accumulateListeners(obj, eventName, otherActions, meta) { function notifyBeforeObservers(obj, keyName, meta) { if (meta.isSourceDestroying()) { return; } - let eventName = `${keyName}:before`; + let eventName = beforeEvent(keyName); let listeners, added; if (deferred > 0) { listeners = beforeObserverSet.add(obj, keyName, eventName); @@ -295,7 +296,7 @@ function notifyBeforeObservers(obj, keyName, meta) { function notifyObservers(obj, keyName, meta) { if (meta.isSourceDestroying()) { return; } - let eventName = `${keyName}:change`; + let eventName = changeEvent(keyName); let listeners; if (deferred > 0) { listeners = observerSet.add(obj, keyName, eventName);