watchConnection

1function watchConnection(config): (onChange) => any;

Defined in: account-kit/core/src/actions/watchConnection.ts:18

Subscribe to changes to the active connection

Example

1import { watchConnection } from "@account-kit/core";
2// see createConfig for more information on how to create a config
3import { config } from "./config";
4
5watchConnection(config)(console.log);

Parameters

ParameterTypeDescription

config

AlchemyAccountsConfig

the account config

Returns

a function which accepts an onChange callback that will be fired when the connection changes and returns a function to unsubscribe from the store

1(onChange): any;

Parameters

ParameterType

onChange

(connection) => void

Returns

any