Smootify.once()
The once method of window.Smootify.
New in 2.0.
once<N extends SmootifyEventName | SmootifyShortEventName>( name: N, handler: SmootifyEventHandler<N>, ): () => voidTypes
SmootifyEventName
export type SmootifyEventName = keyof SmootifyEventMap;SmootifyShortEventName
/** A `smootify:` event by its name alone: `cart_updated`, `wishlist:changed_product`. */
export type SmootifyShortEventName = {
[K in SmootifyEventName]: K extends `smootify:${infer Short}` ? Short : never;
}[SmootifyEventName];SmootifyEventHandler
export type SmootifyEventHandler<N extends SmootifyEventName | SmootifyShortEventName> = (
payload: SmootifyEventMap[FullEventName<N>],
) => void;