Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 4x 4x 4x 4x 1x 1x | import { createContext, useContext } from 'react';
import { type CalculationType } from '@amalia/core/types';
import { assert } from '@amalia/ext/typescript';
interface PlanHubRuleDesignerContextType {
planId: string;
ruleId: string;
calculationType: CalculationType;
}
const PlanHubRuleDesignerContext = createContext<PlanHubRuleDesignerContextType | null>(null);
export const usePlanHubRuleDesignerContext = () => {
const context = useContext(PlanHubRuleDesignerContext);
assert(context, 'Not in a PlanHubRuleDesignerContext');
return context;
};
export const PlanHubRuleDesignerContextProvider = PlanHubRuleDesignerContext.Provider;
|