F

onAction

Runs a listener for each Flux action of one type, after Discord's stores handle it.

function onAction<K extends FluxActionType>(type: K, listener: FluxActionListener<K>): () => void

Parameters

NameTypeDescription
typeK

The action type, like 'MESSAGE_CREATE'.

listenerFluxActionListener<K>

Runs with each action. An error it throws is logged.

Returns

() => void

A function that removes the listener.