@yext/search-headless
Version:
A library for powering UI components for Yext Search integrations
22 lines (21 loc) • 507 B
text/typescript
import { State } from './state';
/**
* Represents a listener for a specific value of type T in the state.
*
* @public
*/
export default interface StateListener<T> {
/**
* Accesses a value of type T in the state.
*
* @param state - The current state
* @returns The value of type T from the state
*/
valueAccessor(state: State): T,
/**
* The function to call when the state value updates.
*
* @param currentValue - The current state value
*/
callback(currentValue: T)
}