-
Notifications
You must be signed in to change notification settings - Fork 403
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(store): merge options with default options #1686
Conversation
BTW I love this project, it really helped me out on a project I did for a customer. Handling state in a SPA style application that stores a lot of data in memory, would've been really complicated otherwise. |
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.
Top-quality PR. Well done and thank you!
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?
Issue Number: #1683
What is the new behavior?
The values that are set in the options object are supplied by the default options. This behaviour was already partially implemented using
Object.assign
, however that function does not merge deeply. This then affected theselectorOptions
for theNgxsStoreModule
, as they are a object inside theoptions
object. The new util functionmergeDeep
does basically the same thing asObject.assign
but also deeply.Does this PR introduce a breaking change?
Not sure if this counts as "breaking", but for example if someone set the
selectorOptions
, with the intent on disabling the optioninjectContainerState
implicitly,then this would now result in
injectContainerState
becoming true instead of false (in reality it is "falsy" and not false).Other information
I had to fix one selector test by explicitly setting the option to false, as it was making use of this implicit "falsyness".
I also added some code to the example, this see if container injection is on or off.
Since i saw you explicitly allow the launch.json to be commited (in the gitignore) i added my jest debugging launch configurations.