Skip to content
On this page

createGlobalState

创建全局状态

代码演示

基础用法

API

javascript
const useGlobalState = createGlobalState<T>(defineState: () => T): () => T
const useGlobalState = createGlobalState<T>(defineState: () => T): () => T

Params

参数说明类型默认值
defineState必填,需要定义的全局变量 () => T-