package vue-jsoo

  1. Overview
  2. Docs

Module VuexSource

Sourcetype 'state action_input = {
  1. state : 'state Mjs.t;
  2. getters : ('state Mjs.t -> ('state Mjs.t -> Mjs.any) Mjs.table -> Mjs.any) Mjs.table;
  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 -> (Mjs.any -> Mjs.any) Mjs.table -> Mjs.any) Mjs.table 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 options = 'state 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 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 Internal.dynamic_cs_options Mjs.t Mjs.table_cons;
  9. namespaced : bool option;
}

store constructor options

Sourcetype 'state store = 'state Internal.instance_js Mjs.t

JS store object

Sourcetype 'state module_obj = 'state Internal.dynamic_cs_options Mjs.t

JS module object

Sourceval empty : 'state Mjs.t -> 'state options

empty constructor options

Sourceval make : 'state options -> 'state store

main make store function

Sourceval make_module : 'state options -> 'state module_obj

make module store function

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

get state of store

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

get value of one of the getters

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

commit to the state of the store

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

dispatch to the state of the store

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

replace the state of the store

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

hook for mutation subscription

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

hook for action subscription

Sourceval register_module : 'state store -> string -> Mjs.top options -> unit

register a new module to the store

Sourceval unregister_module : 'state store -> string -> unit

unregister a module of the store

Sourceval has_module : 'state store -> string -> bool

module existence

Sourceval hot_update : 'state store -> '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
Sourcemodule type Make_S = sig ... end
Sourcemodule Make (S : sig ... end) : Make_S with type state = S.state
Sourcemodule type Module_S = sig ... end
Sourcemodule Module (S : sig ... end) : Module_S with type state = S.state
OCaml

Innovation. Community. Security.