Home > @elux/model

model package

Classes

ClassDescription
BaseModelModel基类
EmptyModel空Model常用于mock假数据

Functions

FunctionDescription
deepMerge(target, args)多个PlainObject的深度Merge
effect(loadingKey)申明effect
effectLogger(before, after)跟踪effect执行的钩子
errorAction(error)创建一个特殊的ErrorAction
exportComponent(component)向外导出UI组件
exportModule(moduleName, ModelClass, components, data)向外封装并导出Module
exportView(component)向外导出业务视图
getApi(demoteForProductionOnly, injectActions)获取应用全局方法
getTplInSSR()获取SSR页面模版
injectModule(module)动态注册Module
injectModule(moduleName, moduleGetter)动态注册module
isMutable()当前State模式是否为Mutable
isServer()当前是否是Server运行环境
locationToNativeLocation(location)内部路由Location转换为原生路由Location
locationToUrl({ url, pathname, search, hash, classname, searchQuery, hashQuery }, defClassname)Location转换为Url
modelHotReplacement(moduleName, ModelClass)model热更新
moduleExists(moduleName)模块是否存在
nativeLocationToLocation(location)原生路由Location转换为内部路由Location
nativeUrlToUrl(nativeUrl)原生路由Url转换为内部路由Url
patchActions(typeName, json)用于兼容不支持Proxy的低版本浏览器
reducer(target, key, descriptor)申明reducer
setConfig(conf)全局参数设置
setLoading(item, store, _moduleName, _groupName)LoadingState注入指定ModuleState
urlToLocation(url, state)Url转换为Location
urlToNativeUrl(eluxUrl)内部路由Url转换为原生路由Url

Variables

VariableDescription
env运行环境的引用
ErrorCodes内置ErrorCode