platform icon indicating copy to clipboard operation
platform copied to clipboard

Module/Codesplitting Issue with @angular-redux/form

Open maplion opened this issue 7 years ago • 0 comments

I am currently using @angular-redux/form 9.0.1 and when I tried to modularize my application using a reducer registry, I was unable to avoid this error: Typeerror: cannot read property 'getstate' of undefined at rootstore._this.getstate (root-store.js:40) coming from @angular-redux/form when loading any component that had a form with [connect] that was inside of a lazy-loaded module.

I was able to make a workaround in the following form by removing the [connect] altogether and mimicking the behavior like this:

this.subscriptionToForm = this.form.valueChanges.subscribe(value => {
    this.myService.dispatchPayload('@@angular-redux/form/FORM_CHANGED', { path: myFormPath, value });
});

This seems to work fine and resolves my current issue, but I wanted to mention the issue as you move forward with development on these packages.

maplion avatar Oct 18 '18 04:10 maplion