Closed togonow closed 7 years ago
the example in the documentation uses thunk within the element as below. i'm trying to separate the logic from the polymer element `class DemoApp extends ReduxMixin(Polymer.Element) { // ...
connectedCallback() { super.connectedCallback();
// Update message using Redux Thunk
this.dispatch((dispatch) => {
dispatch('updateMessage', 'Please wait...');
// Do async task
setTimeout(() => {
dispatch('updateMessage', 'Sorry for being late!');
}, 1000);
});
} }`
See my update to Polycast 62 for how I did it: https://github.com/johnthad/polycast62 and read this excellent post on mixins by Justin Fagini.
(My Polycast 61 is here https://github.com/johnthad/polycast62)
Thank you soo much
Awesome!
How to define a redux thunk that can be mixed in (used to be in the behavior array) with the new polylmer 2.0 elements.