From 708d2ecbbe94554604b6ee27671d17328f30d0f0 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 20 Apr 2016 01:00:53 +0100 Subject: [PATCH] Style tweaks --- src/createStore.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/createStore.js b/src/createStore.js index 806aeba922..0c59bb0689 100644 --- a/src/createStore.js +++ b/src/createStore.js @@ -218,24 +218,20 @@ export default function createStore(reducer, initialState, enhancer) { */ subscribe(observer) { if (typeof observer !== 'object') { - throw new TypeError('Expected observer to be an object') + throw new TypeError('Expected the observer to be an object.') } - var observeState = () => { + function observeState() { if (observer.next) { observer.next(getState()) } } - // send initial state to observer observeState() - - // send subsequent states to observer var unsubscribe = outerSubscribe(observeState) - - // return an unsubscribable return { unsubscribe } }, + [$$observable]() { return this }