watchUser

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

Defined in: account-kit/core/src/actions/watchUser.ts:20

Watches for changes to the user in the client store and triggers the provided callback when a change is detected.

Example

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

Parameters

ParameterTypeDescription

config

AlchemyAccountsConfig

the configuration containing the client store

Returns

a function which accepts a callback that fires when the user changes and returns a function to unsubscribe from the user updates

1(onChange): any;

Parameters

ParameterType

onChange

(user?) => void

Returns

any