Skip to content

watchSigner

Subscribe to changes of the signer instance on the client store.

Import

import { watchSigner } from "@account-kit/core";

Usage

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

Parameters

config

AlchemyAccountsConfig the account config containing the client store

Returns

(onChange: (chain: AlchemyWebSigner) => void) => (() => void) a function which accepts an onChange callback that will be fired when the signer changes and returns a function to unsubscribe from the store