Skip to content

Commit

Permalink
fix: remove original source of subscribe decorator
Browse files Browse the repository at this point in the history
This was left over from a previous pass and I forgot to actually delete the
commented-out code!
  • Loading branch information
alexlafroscia committed Jan 29, 2019
1 parent 6b66b92 commit a0d5959
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions addon/decorators/subscribe.js
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit a0d5959

Please sign in to comment.