Skip to content

Commit

Permalink
fix(form): restore the form state consistently with the local storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Kairis committed Oct 2, 2018
1 parent 28a47ea commit a67656c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/examples/form/components/form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class FormComponent implements OnInit, OnDestroy {
ngOnInit() {
this.store
.pipe(select(selectForm), take(1))
.subscribe(form => this.form.patchValue(form));
.subscribe(form => this.form.patchValue(form.form));

this.form.valueChanges
.pipe(
Expand Down
2 changes: 1 addition & 1 deletion src/app/examples/form/form.effects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class FormEffects {
persistForm = this.actions$.pipe(
ofType<ActionFormUpdate>(FormActionTypes.UPDATE),
tap(action =>
this.localStorageService.setItem(FORM_KEY, action.payload.form)
this.localStorageService.setItem(FORM_KEY, { form: action.payload.form })
)
);
}

0 comments on commit a67656c

Please sign in to comment.