@polkadot-onboard/react
Advanced tools
Comparing version 0.0.9-beta to 0.0.9
@@ -5,2 +5,3 @@ import type { BaseWallet, WalletAggregator } from '@polkadot-onboard/core'; | ||
walletAggregator: WalletAggregator; | ||
initialWaitMs?: number; | ||
} | ||
@@ -11,3 +12,3 @@ interface PolkadotWalletsContextProps { | ||
export declare const useWallets: () => PolkadotWalletsContextProps; | ||
export declare const PolkadotWalletsContextProvider: ({ children, walletAggregator }: PolkadotWalletsContextProviderProps) => JSX.Element; | ||
export declare const PolkadotWalletsContextProvider: ({ children, walletAggregator, initialWaitMs, }: PolkadotWalletsContextProviderProps) => JSX.Element; | ||
export {}; |
@@ -7,6 +7,9 @@ import { jsx as _jsx } from "react/jsx-runtime"; | ||
export const useWallets = () => useContext(PolkadotWalletsContext); | ||
export const PolkadotWalletsContextProvider = ({ children, walletAggregator }) => { | ||
export const PolkadotWalletsContextProvider = ({ children, walletAggregator, initialWaitMs = 5 /* the default is set to 5ms to give extensions enough lead time to inject their providers */, }) => { | ||
const [wallets, setWallets] = useState(); | ||
useEffect(() => { | ||
setWallets(walletAggregator.getWallets()); | ||
const timeoutId = setTimeout(() => { | ||
setWallets(walletAggregator.getWallets()); | ||
}, initialWaitMs); | ||
return () => clearTimeout(timeoutId); | ||
}, [walletAggregator]); | ||
@@ -13,0 +16,0 @@ const contextData = useMemo(() => ({ |
{ | ||
"name": "@polkadot-onboard/react", | ||
"version": "0.0.9-beta", | ||
"version": "0.0.9", | ||
"author": "Parity Team <admin@parity.io>", | ||
@@ -31,8 +31,7 @@ "maintainers": [ | ||
"devDependencies": { | ||
"@polkadot-onboard/core": "0.0.8-beta", | ||
"@polkadot-onboard/core": "0.0.9", | ||
"@types/react": "18.0.28", | ||
"prettier": "2.8.4", | ||
"typescript": "4.9.5" | ||
}, | ||
"stableVersion": "0.0.7-beta" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
5419
78
0