concent

concent

  • Docs
  • API
  • ChangeLog
  • GitHub

›顶层api

顶层api

  • run
  • configure
  • cloneModule
  • register
  • connect
  • connectDumb
  • emit
  • emitWith
  • dispatch
  • getState
  • getGlobalState
  • getComputed
  • setState
  • setGlobalState
  • call
  • execute
  • executeAll

通用类型解释

  • HandlerCtx
  • CcFragmentCtx
  • WatchFn

实例上下文api

  • ctx.dispatch
  • ctx.invoke
  • ctx.setState
  • ctx.setModuleState
  • ctx.setGlobalState
  • ctx.computed
  • ctx.watch
  • ctx.syncBool
  • ctx.set
  • ctx.emit
  • ctx.on
  • ctx.off

CcFragment api

  • Fifth Document

通用api

  • dispatch

获取缓存计算值


获取指定模块的缓存计算值

函数签名

getComputed: (module:string)=>object

如果使用

import { getComputed } from 'concent';
// import cc from 'concent'; cc.getComputed

getComputed('foo');

何时使用

在cc类、reducer方法外部时想要拿到某个模块的计算值

在cc类实例里的可以通过this.$$refComputed、this.$$moduleComputed、this.$$connectedComputed、this.$$globalComputed拿到实例计算值,模块计算值,全局计算值

console里使用

打开浏览器console窗口,输入cc.getComputed即可以console里使用该接口

← getGlobalStatesetState →
  • 函数签名
  • 如果使用
  • 何时使用
  • console里使用
Copyright © 2019 concentjs.org