From 87c132840272e95ac2c10175792e8c238d1485eb Mon Sep 17 00:00:00 2001 From: Tim Pietrusky Date: Sun, 18 Feb 2018 16:41:42 +0100 Subject: [PATCH] refactor(state-changed): Removed state-changed event Implements #127 --- polymer-redux.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/polymer-redux.js b/polymer-redux.js index 58adc65..166c240 100644 --- a/polymer-redux.js +++ b/polymer-redux.js @@ -10,7 +10,7 @@ import {get} from '../@polymer/polymer/lib/utils/path.js'; * @param {Object} store Redux store. * @return {Function} Class mixin. */ -export default function PolymerRedux(store, mixinProperties = { enableStateChangedEvent: true }) { +export default function PolymerRedux(store) { if (!store) { throw new TypeError('PolymerRedux: expecting a redux store.'); } else if (!['getState', 'dispatch', 'subscribe'].every(k => typeof store[k] === 'function')) { @@ -70,11 +70,6 @@ export default function PolymerRedux(store, mixinProperties = { enableStateChang const unsubscribe = store.subscribe(() => { const detail = store.getState(); update(detail); - - if (mixinProperties.enableStateChangedEvent) { - element.dispatchEvent(new CustomEvent('state-changed', {detail})); - } - }); subscribers.set(element, unsubscribe);