angular-redux / platform

[Unmaintained] Redux bindings and utilities for Angular

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module/Codesplitting Issue with @angular-redux/form

maplion opened this issue · 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.