Skip to content

Commit

Permalink
bump to zustand rc
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahZinsmeister committed Apr 25, 2022
1 parent 3e0a078 commit 3f9e639
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"dependencies": {
"@web3-react/store": "^8.0.17-beta.0",
"@web3-react/types": "^8.0.12-beta.0",
"zustand": "^4.0.0-beta.3"
"zustand": "^4.0.0-rc.0"
},
"peerDependencies": {
"react": ">=16.8"
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function initializeConnector<T extends Connector>(
const [store, actions] = createWeb3ReactStoreAndActions(allowedChainIds)

const connector = f(actions)
const useConnector = create<Web3ReactState>(store)
const useConnector = create(store)

const stateHooks = getStateHooks(useConnector)
const derivedHooks = getDerivedHooks(stateHooks)
Expand Down Expand Up @@ -246,7 +246,7 @@ const ACCOUNTS_EQUALITY_CHECKER: EqualityChecker<Web3ReactState['accounts']> = (
const ACTIVATING = (state: Web3ReactState) => state.activating
const ERROR = (state: Web3ReactState) => state.error

function getStateHooks(useConnector: UseBoundStore<Web3ReactState>) {
function getStateHooks(useConnector: UseBoundStore<Web3ReactStore>) {
function useChainId(): Web3ReactState['chainId'] {
return useConnector(CHAIN_ID)
}
Expand Down
8 changes: 4 additions & 4 deletions packages/core/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ [email protected]:
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c"
integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==

zustand@^4.0.0-beta.3:
version "4.0.0-beta.3"
resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-beta.3.tgz#16dc82b48b65ed61fe2bae5dea4501f49bd450c7"
integrity sha512-cVDcspaK0CXgVmGcXB/oenhT7EFaKqD46pTmg30ciMsOoQN0ZuxEuHzpNIy9ejah0gzBL8aqHN89IMT2uFNOaA==
zustand@^4.0.0-rc.0:
version "4.0.0-rc.0"
resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-rc.0.tgz#644982d70ea1eba3b6983790608bfe101afdd649"
integrity sha512-jMimx6EIlLb/hwgnkVZ4Wd/UI73wXedUB6L/kcdIYbOYHcjIFRc7JEB8IXFZt+1rQq2qwuts7kN6kuHhFss47A==
dependencies:
use-sync-external-store "1.0.0"
2 changes: 1 addition & 1 deletion packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"dependencies": {
"@ethersproject/address": "^5",
"@web3-react/types": "^8.0.12-beta.0",
"zustand": "^4.0.0-beta.3"
"zustand": "^4.0.0-rc.0"
}
}
4 changes: 2 additions & 2 deletions packages/store/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getAddress } from '@ethersproject/address'
import type { Actions, Web3ReactState, Web3ReactStateUpdate, Web3ReactStore } from '@web3-react/types'
import create from 'zustand/vanilla'
import { createStore } from 'zustand'

/**
* MAX_SAFE_CHAIN_ID is the upper bound limit on what will be accepted for `chainId`
Expand Down Expand Up @@ -49,7 +49,7 @@ export function createWeb3ReactStoreAndActions(allowedChainIds?: number[]): [Web
throw new Error(`allowedChainIds is length 0`)
}

const store = create<Web3ReactState>(() => DEFAULT_STATE)
const store = createStore<Web3ReactState>()(() => DEFAULT_STATE)

// flag for tracking updates so we don't clobber data when cancelling activation
let nullifier = 0
Expand Down
8 changes: 4 additions & 4 deletions packages/store/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ [email protected]:
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.0.0.tgz#d98f4a9c2e73d0f958e7e2d2c2bfb5f618cbd8fd"
integrity sha512-AFVsxg5GkFg8GDcxnl+Z0lMAz9rE8DGJCc28qnBuQF7lac57B5smLcT37aXpXIIPz75rW4g3eXHPjhHwdGskOw==

zustand@^4.0.0-beta.3:
version "4.0.0-beta.3"
resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-beta.3.tgz#16dc82b48b65ed61fe2bae5dea4501f49bd450c7"
integrity sha512-cVDcspaK0CXgVmGcXB/oenhT7EFaKqD46pTmg30ciMsOoQN0ZuxEuHzpNIy9ejah0gzBL8aqHN89IMT2uFNOaA==
zustand@^4.0.0-rc.0:
version "4.0.0-rc.0"
resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-rc.0.tgz#644982d70ea1eba3b6983790608bfe101afdd649"
integrity sha512-jMimx6EIlLb/hwgnkVZ4Wd/UI73wXedUB6L/kcdIYbOYHcjIFRc7JEB8IXFZt+1rQq2qwuts7kN6kuHhFss47A==
dependencies:
use-sync-external-store "1.0.0"
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"start": "tsc --watch"
},
"dependencies": {
"zustand": "^4.0.0-beta.3"
"zustand": "^4.0.0-rc.0"
}
}
2 changes: 1 addition & 1 deletion packages/types/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { EventEmitter } from 'node:events'
import type { State, StoreApi } from 'zustand/vanilla'
import type { State, StoreApi } from 'zustand'

export interface Web3ReactState extends State {
chainId: number | undefined
Expand Down
8 changes: 4 additions & 4 deletions packages/types/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ [email protected]:
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.0.0.tgz#d98f4a9c2e73d0f958e7e2d2c2bfb5f618cbd8fd"
integrity sha512-AFVsxg5GkFg8GDcxnl+Z0lMAz9rE8DGJCc28qnBuQF7lac57B5smLcT37aXpXIIPz75rW4g3eXHPjhHwdGskOw==

zustand@^4.0.0-beta.3:
version "4.0.0-beta.3"
resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-beta.3.tgz#16dc82b48b65ed61fe2bae5dea4501f49bd450c7"
integrity sha512-cVDcspaK0CXgVmGcXB/oenhT7EFaKqD46pTmg30ciMsOoQN0ZuxEuHzpNIy9ejah0gzBL8aqHN89IMT2uFNOaA==
zustand@^4.0.0-rc.0:
version "4.0.0-rc.0"
resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.0.0-rc.0.tgz#644982d70ea1eba3b6983790608bfe101afdd649"
integrity sha512-jMimx6EIlLb/hwgnkVZ4Wd/UI73wXedUB6L/kcdIYbOYHcjIFRc7JEB8IXFZt+1rQq2qwuts7kN6kuHhFss47A==
dependencies:
use-sync-external-store "1.0.0"

0 comments on commit 3f9e639

Please sign in to comment.