import React, { createContext, useContext } from 'react';
var ActionsHookContext = createContext(null);
ActionsHookContext.displayName = 'ActionsHookContext';
export var ActionsHookProvider = function (_a) {
    var children = _a.children, hook = _a.hook;
    return React.createElement(ActionsHookContext.Provider, { value: hook }, children);
};
export var useActionsHook = function () {
    var listenToActions = useContext(ActionsHookContext);
    if (!listenToActions) {
        throw new Error('ActionsHookContext must be provided');
    }
    return listenToActions;
};
