-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(component-store): move isInitialized check to queueScheduler context on state update #3492
fix(component-store): move isInitialized check to queueScheduler context on state update #3492
Conversation
✅ Deploy Preview for ngrx-io canceled.Built without sensitive environment variables
|
expect(() => { | ||
queueScheduler.schedule(() => { | ||
const componentStore = new ComponentStore({ foo: false }); | ||
componentStore.patchState({ foo: true }); | ||
}); | ||
}).not.toThrow(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test would fail before this PR
…ext on state update Closes ngrx#2991
cc47494
to
d997c1c
Compare
throwError(() => new Error(this.notInitializedErrorMessage)) | ||
), | ||
// Push the value into queueScheduler | ||
observeOn(queueScheduler), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was very confident that observeOn
was deprecated in favour of scheduled
. Apparently I was dreaming?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😁 AFAIK, the signature of the of
function that accepts scheduler is deprecated in favor of scheduled
.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #2991
What is the new behavior?
There is no initialization error when ComponentStore initialization and state update are scheduled via
queueScheduler
.Does this PR introduce a breaking change?