Skip to content

Commit

Permalink
Avoid error when a property is named store
Browse files Browse the repository at this point in the history
  • Loading branch information
aralroca committed Sep 24, 2021
1 parent 4aeded9 commit 19c5074
Show file tree
Hide file tree
Showing 3 changed files with 3,602 additions and 2 deletions.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export default function createStore(store = {}) {
const state = {}
const updates = {}
keys.forEach((k) => {
const [s, u] = storeUtils[`use${capitalize(k)}`]()
const hookName = `use${capitalize(k)}`
if (hookName === 'useStore') return
const [s, u] = storeUtils[hookName]()
state[k] = s
updates[k] = u
})
Expand Down
Loading

0 comments on commit 19c5074

Please sign in to comment.