UNPKG

botui

Version:

Build customizable conversational UIs and bots

15 lines (14 loc) 362 B
export function actionManager(callback = (action) => { }) { let currentAction = null; return { get: () => currentAction, set: (action) => { currentAction = action; callback(currentAction); }, clear: () => { currentAction = null; callback(currentAction); }, }; }