State

State

Stores the state of an API request.

Members

Fields & Properties
Methods

Constructor

new State(value, route, type, origin, binding)

Parameters
Name Type Description
value object | function

The object of the Api that created this State.

route Array.<any>

The route of the Api that created this State.

type string

"route" if this State is given to a router and "close" if given to a closer.

origin object

The origin of the Api that created this State.

binding Binding

The Binding object of State#value. This has to be set, because clone-Bindings do not bind the object itself and thus hold no reference to the Binding.

Members

binding :object

The binding that was given to the constructor.

modified :boolean

true if this state was the result of a State#setValue call, false elsewise.

origin :object

The origin that was given to the constructor.

route :Array.<any>

The route that was given to the constructor.

type :string

The type ("route" or "close") that was given to the constructor.

value :object|function

The value that was given to the constructor.

Methods

setValue(valueDescriptor) → {State}

Returns a new state, that prototypically inherits from this State, but with another value. The new state will get an active State#modified flag.

Parameters
Name Type Description
valueDescriptor any

The new value.

Returns

A new State.

Type
State