Skip to content

Conversation

GuyTuval
Copy link

Fixed problem of potentially unsubscribed subscription

@GuyTuval GuyTuval changed the title Fixed issue 7 Fixed daptontech/ ngxs-crud-app#7 Mar 19, 2020
@GuyTuval GuyTuval changed the title Fixed daptontech/ ngxs-crud-app#7 Fixed daptontech/ngxs-crud-app#7 Mar 19, 2020
@GuyTuval GuyTuval changed the title Fixed daptontech/ngxs-crud-app#7 Fixes daptontech/ngxs-crud-app#7 Mar 19, 2020
@GuyTuval GuyTuval closed this Mar 19, 2020
@GuyTuval GuyTuval reopened this Mar 19, 2020
} else {
this.formSubscription.add(
this.formSubscription = this.store.dispatch(new AddTodo(this.todoForm.value)).subscribe(() => {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this section, it accidentally reinitiates the formSubscription and removes the previously added subscriptions (for example, the selectedTodo subscription).

@GuyTuval
Copy link
Author

Hi @daptontech 😄
First off, thanks for your article about Angular NGXS!
I noticed a little bug in the code so I opened this PR to solve it, would you mind reviewing it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant