package vue-jsoo

  1. Overview
  2. Docs

Module VuexSource

Sourcetype ('state, 'getters) action_input = {
  1. state : 'state Mjs.t;
  2. getters : 'getters Mjs.t;
  3. commit : ?payload:Mjs.any -> string -> unit;
  4. dispatch : ?payload:Mjs.any -> string -> Mjs.unit_promise Mjs.t;
  5. root_state : Mjs.any option;
  6. root_getters : Mjs.any option;
}

input for actions

Sourcetype 'payload mutation = {
  1. name : string;
  2. payload : 'payload;
}

mutation type for subscribe

Sourcemodule Internal : sig ... end

internal JS module

Sourcetype ('state, 'getters) options = ('state, 'getters) Internal.options = {
  1. o_state : 'state Mjs.t;
  2. o_getters : ('state Mjs.t -> Mjs.any) Mjs.table_cons;
  3. mutations : ('state Mjs.t -> Mjs.any -> unit) Mjs.table_cons;
  4. actions : (('state, 'getters) action_input -> Mjs.any -> unit) Mjs.table_cons;
  5. plugins : Mjs.any list option;
  6. strict : bool option;
  7. devtools : bool option;
  8. modules : (Mjs.top, Mjs.top) Internal.dynamic_cs_options Mjs.t Mjs.table_cons;
  9. namespaced : bool option;
}

store constructor options

Sourceclass type 'state store = 'state Internal.instance_js

JS store object

Sourceclass type ['state, 'getters] module_obj = ['state, 'getters] Internal.dynamic_cs_options

JS module object

Sourceval empty : 'state Mjs.t -> ('state, 'getters) options

empty constructor options

Sourceval make : ('state, 'getters) options -> 'state store Mjs.t

main make store function

Sourceval make_module : ('state, 'getters) options -> ('state, 'getters) module_obj Mjs.t

make module store function

Sourceval state : 'state store Mjs.t -> 'state Mjs.t

get state of store

Sourceval get : 'state store Mjs.t -> string -> Mjs.any

get value of one of the getters

Sourceval commit : ?payload:Mjs.any -> ?root:bool -> 'state store Mjs.t -> string -> unit

commit to the state of the store

Sourceval dispatch : ?payload:Mjs.any -> ?root:bool -> 'state store Mjs.t -> string -> (Mjs.unit_promise Mjs.t -> 'async) -> 'async

dispatch to the state of the store

Sourceval replace_state : 'state store Mjs.t -> 'state Mjs.t -> unit

replace the state of the store

Sourceval subscribe : 'state store Mjs.t -> ('a mutation -> 'state Mjs.t -> unit) -> unit

hook for mutation subscription

Sourceval subscribe_action : 'state store Mjs.t -> ('a mutation -> 'state Mjs.t -> unit) -> unit

hook for action subscription

Sourceval register_module : 'state store Mjs.t -> string -> (Mjs.top, Mjs.top) options -> unit

register a new module to the store

Sourceval unregister_module : 'state store Mjs.t -> string -> unit

unregister a module of the store

Sourceval has_module : 'state store Mjs.t -> string -> bool

module existence

Sourceval hot_update : 'state store Mjs.t -> 'a -> unit
Sourcemodule Map : sig ... end

Binding helpers

Sourcemodule type Tables_S = sig ... end
Sourcemodule Tables (S : sig ... end) : Tables_S with type state = S.state and type getters = S.getters
Sourcemodule type Make_S = sig ... end
Sourcemodule Make (S : sig ... end) : Make_S with type state = S.state and type getters = S.getters
Sourcemodule type Module_S = sig ... end
Sourcemodule Module (S : sig ... end) : Module_S with type state = S.state and type getters = S.getters
OCaml

Innovation. Community. Security.