Skip to content

Commit

Permalink
refactor(state-changed): Removed state-changed event
Browse files Browse the repository at this point in the history
Implements tur-nr#127
  • Loading branch information
TimPietrusky committed Feb 18, 2018
1 parent e493e21 commit 87c1328
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions polymer-redux.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 87c1328

Please sign in to comment.