Skip to content
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 Array in useStore (v10.0.1) #152

Merged
merged 1 commit into from
Feb 8, 2021
Merged

Fix Array in useStore (v10.0.1) #152

merged 1 commit into from
Feb 8, 2021

Conversation

JRJurman
Copy link
Member

@JRJurman JRJurman commented Feb 8, 2021

Summary

In the release of v10, the ability to store arrays was broken (because to make a shallow copy, the spread syntax for objects was used, but this inadvertently changed arrays to objects). There was no regression test for this, so a new one has been added.

Checklist

  • PR Summary
  • Tests
  • Version Bump

@@ -10,7 +10,7 @@ const observableHook = require('./observable-hook')
* it will cause only the components that are dependent on that value to update.
*
* @param {string} key a unique string to write and read the global value
* @param {Object|Array} value the default value to start the state at
* @param {Object|Array} defaultValue the default value to start the store at
Copy link
Member Author

Choose a reason for hiding this comment

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

also taking this opportunity to change the parameter jsdoc here, it should be default value, as that is what it is.

@JRJurman JRJurman merged commit 9cca6b9 into master Feb 8, 2021
@JRJurman JRJurman deleted the fix-array-store branch February 8, 2021 06:24
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