I want to extend aurelia-store and add two methods to it
and it is not working …
following It is my code
import {Store} from "aurelia-store";
export class PaStore extends Store {
constructor() {
super();
}
registerActions(Actions) {
for (let action in Actions) {
if (Actions.hasOwnProperty(action)) {
super.registerAction(action, Actions[action]);
}
}
}
unregisterActions(Actions) {
for (let action in Actions) {
if (Actions.hasOwnProperty(action)) {
super.unregisterAction(action, Actions[action]);
}
}
}
}
and then I added following config to main.js file
import {Store} from "aurelia-store";
import {PaStore} from './utilities/services/PaStore';
export function configure(aurelia) {
aurelia.container.registerSingleton(Store, PaStore); // to add methods to Store to register and unregister array of actions aurelia.use
.standardConfiguration()
.feature(PLATFORM.moduleName('resources/index'))
.feature(PLATFORM.moduleName('validation/index'))
.plugin(PLATFORM.moduleName('aurelia-store'), {
initialState
});
aurelia.use.developmentLogging(environment.debug ? 'debug' : 'warn');
if (environment.testing) {
aurelia.use.plugin(PLATFORM.moduleName('aurelia-testing'));
}
aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app')));
}
and it gives this error
please help me