Class type Ext_state_Stateful.t


class type t = object .. end
Inherits
method addStateEvents : 'a. 'a Js.t -> unit Js.meth

Add events that will trigger the state to be saved. If the first argument is an array, each element of that array is the name of a state event. Otherwise, each argument passed to this method is the name of a state event.

Parameters:


method applyState : 'b. 'b Js.t -> unit Js.meth

Applies the state to the object. This should be overridden in subclasses to do more complex state operations. By default it applies the state properties onto the current object.

Parameters:


method destroy : unit Js.meth

Destroys this stateful object.


method getState : 'c. 'c Js.t Js.meth

Gets the current state of the object. By default this function returns null, it should be overridden in subclasses to implement methods for getting the state.

Returns:


method savePropToState : 'd.
Js.js_string Js.t ->
'd Js.t -> Js.js_string Js.t Js.optdef -> bool Js.t Js.meth

Conditionally saves a single property from this object to the given state object. The idea is to only save state which has changed from the initial state so that current software settings do not override future software settings. Only those values that are user-changed state should be saved.

Parameters:

Returns:


method savePropsToState : 'e 'f 'g. 'e Js.t -> 'f Js.t -> 'g Js.t Js.meth

Gathers additional named properties of the instance and adds their current values to the passed state object.

Parameters:

Returns:


method saveState : unit Js.meth

Saves the state of the object to the persistence store.