@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
21 lines (19 loc) • 473 B
text/typescript
export const setNamespace = (namespace: string) => {
return <P = undefined>(type: string, payload?: P) => {
const name = [namespace, type].filter(Boolean).join('/');
return (
payload
? {
payload,
type: name,
}
: name
) as P extends undefined ? string : { payload: P; type: string };
};
};
export type Action =
| string
| {
[x: string | number | symbol]: unknown;
type: string;
};