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

从store里获取指定模块的状态


获取store里的数据

函数签名

getState: ( module?:string)=>object

参数解释

  • module 模块
    不指定模块时,返回的是整个store,指定了模块值,返回的是该模块下的状态

如果使用

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

getState();
getState('foo');

console里使用

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

concent启动完毕后,会将整个store挂载在window.sss下,所以你也可以在console里输入sss然后回车,可以查看整个store

← dispatchgetGlobalState →
  • 函数签名
  • 参数解释
  • 如果使用
  • console里使用
Copyright © 2019 concentjs.org