mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-20 22:25:30 +00:00
13 lines
436 B
TypeScript
13 lines
436 B
TypeScript
import { createContext, useContext } from 'react';
|
|
|
|
export type RegisterInteractionBlocker = () => () => void;
|
|
|
|
const noopRelease = () => {};
|
|
const noopRegisterInteractionBlocker = () => noopRelease;
|
|
|
|
export const InteractionBlockContext =
|
|
createContext<RegisterInteractionBlocker>(noopRegisterInteractionBlocker);
|
|
|
|
export function useInteractionBlocker(): RegisterInteractionBlocker {
|
|
return useContext(InteractionBlockContext);
|
|
}
|