oo-redux-utils2
Version:
Object-oriented Redux utils
22 lines • 704 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Controller {
constructor(reduxDispatch) {
this.dispatch = (action) => reduxDispatch({ type: action });
}
dispatchWithDi(ActionClass, diContainer, otherArgs) {
diContainer
.create(ActionClass, {
...otherArgs,
})
.then((action) => this.dispatch(action));
}
getCachedActionDispatchers(actionDispatchers) {
if (!this.cachedActionDispatchers) {
this.cachedActionDispatchers = actionDispatchers;
}
return this.cachedActionDispatchers;
}
}
exports.default = Controller;
//# sourceMappingURL=Controller.js.map