From a0d59597c31b6de84e06057306e0998eadf769ff Mon Sep 17 00:00:00 2001 From: Alex LaFroscia Date: Mon, 28 Jan 2019 23:12:13 -0800 Subject: [PATCH] fix: remove original source of `subscribe` decorator This was left over from a previous pass and I forgot to actually delete the commented-out code! --- addon/decorators/subscribe.js | 46 ----------------------------------- 1 file changed, 46 deletions(-) diff --git a/addon/decorators/subscribe.js b/addon/decorators/subscribe.js index ac2ec85..54f4d22 100644 --- a/addon/decorators/subscribe.js +++ b/addon/decorators/subscribe.js @@ -1,52 +1,6 @@ import { get, set } from "@ember/object"; import { assert } from "@ember/debug"; -// const subscribe = computedDecoratorWithRequiredParams( -// (descriptor, dependentKeys) => { -// debugger; - -// assert( -// "Only one dependent key can be provided to `subscribe`", -// dependentKeys.length === 1 -// ); - -// const { key } = descriptor; -// const [observablePropertyName] = dependentKeys; - -// let unsubscribe, lastValue, lastObservable; - -// return computed(observablePropertyName, function() { -// const observable = this.get(observablePropertyName); - -// assert( -// `Could not find obserable at \`${observablePropertyName}\``, -// observable -// ); - -// // This method can be called when the observable changes _or_ when -// // the observable emits a new value. We only want to do this logic -// // if the observable changed -// if (observable !== lastObservable) { -// lastObservable = observable; - -// // Clean up we already have a subscription -// if (unsubscribe) { -// unsubscribe(); -// } - -// const subscription = observable.subscribe(value => { -// lastValue = value; -// this.notifyPropertyChange(key); -// }); - -// unsubscribe = subscription.unsubscribe.bind(subscription); -// } - -// return lastValue; -// }); -// } -// ); - export default function subscribe(observableKey) { assert( "Must be passed a property to listen to",