0.0.25 • Published 2 years ago
cj-toolkit-x v0.0.25
js:
import {
appStore,
installer
} from "cj-toolkit-x/dist";
const hook = {
/**
* 所有工作之前调用
* @param appConfig
* @param appStore
*/
compiled(appConfig, appStore) {
console.log(appConfig);
},
/**
* 准备好的换进之前调用
* @param appStore
*/
beforeReady(appStore) {
},
/**
* 准备好的换进之后调用
* @param appStore
*/
afterReady(appStore) {
}
}
// 安装当前插件
installer(hook)
// 日期工具类
export const dateUtils = appStore.getPlugin("dateUtils");
// 对象工具类
export const objectUtils = appStore.getPlugin("objectUtils");
// 数组工具类
export const arrayUtils = appStore.getPlugin("arrayUtils");
// 数据编解码插件
export const dataContract = appStore.getPlugin("dataContract");
// 对象拷贝工具
export const dataCopier = appStore.getPlugin("dataCopier");
// 缓存管理器
export const cacheManager = appStore.getPlugin("cacheManager");
ts:
import {
AppConfig,
AppStore,
appStore,
ArrayUtils,
CacheManager,
DataContract,
DataCopier,
DateUtils,
installer,
ObjectUtils
} from "cj-toolkit-x/dist";
const hook: AppRunHook = {
/**
* 所有工作之前调用
* @param appConfig
* @param appStore
*/
compiled(appConfig: AppConfig, appStore: AppStore) {
},
/**
* 准备好的环境之前调用
* @param appStore
*/
beforeReady(appStore: AppStore) {
},
/**
* 准备好的环境之后调用
* @param appStore
*/
afterReady(appStore: AppStore) {
}
}
// 安装插件
installer(hook)
// 日期工具类
export const dateUtils = appStore.getPlugin("dateUtils") as DateUtils;
// 对象工具类
export const objectUtils = appStore.getPlugin("objectUtils") as ObjectUtils;
// 数组工具类
export const arrayUtils = appStore.getPlugin("arrayUtils") as ArrayUtils;
// 数据编解码插件
export const dataContract = appStore.getPlugin("dataContract") as DataContract;
// 对象拷贝工具
export const dataCopier = appStore.getPlugin("dataCopier") as DataCopier;
// 缓存管理器
export const cacheManager = appStore.getPlugin("cacheManager") as CacheManager;
0.0.22
2 years ago
0.0.23
2 years ago
0.0.24
2 years ago
0.0.25
2 years ago
0.0.21
2 years ago
0.0.20
2 years ago
0.0.15
3 years ago
0.0.16
3 years ago
0.0.17
2 years ago
0.0.18
2 years ago
0.0.19
2 years ago
0.0.10
3 years ago
0.0.11
3 years ago
0.0.12
3 years ago
0.0.13
3 years ago
0.0.14
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago