mirror of
https://github.com/motajs/template.git
synced 2026-11-01 06:04:30 +08:00
chore: 调整加载接口
This commit is contained in:
1 parent
2f3d3387a0
commit
d1ebca0b16
3 files changed
+4
-7
No files matched your search
+2
-5
@@ -22,14 +22,11 @@ export function createCoreStateConfig(
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建数据端主对象,返回经过初始化的主对象实例
|
||||
* 创建数据端主对象,返回未经过初始化的主对象实例,需要手动调用 `state.load` 初始化
|
||||
* @param starter 加载启动器
|
||||
*/
|
||||
export async function createCoreState(
|
||||
starter: ILoadTaskStarter
|
||||
): Promise<ICoreState> {
|
||||
export function createCoreState(starter: ILoadTaskStarter): ICoreState {
|
||||
const config = createCoreStateConfig(starter);
|
||||
const state = new CoreState(config);
|
||||
await state.load();
|
||||
return state;
|
||||
}
|
||||
Reference in new issue
Block a user