Home Manual Reference Source Repository
import Context from 'vulp/src/Context.js'
public class | source

Context

Context is passed to all components.

Static Method Summary

Static Public Methods
public static

create Context of state, transform is identity

Constructor Summary

Public Constructor
public

constructor(instance: Object)

Context constructors

Method Summary

Public Methods
public

check if ctx has changed

public

get(path: string | JSONPointer, toJS: boolean): any

get value from state

public

update(patchSet: *): *

Static Public Methods

public static ofState(state: object): Context source

create Context of state, transform is identity

Params:

NameTypeAttributeDescription
state object

state of ctx

Return:

Context

Public Constructors

public constructor(instance: Object) source

Context constructors

Params:

NameTypeAttributeDescription
instance Object

instances sdds

instance.state Object

states sd

instance.transform Transform

transform sdds

Public Methods

public changed(last: Context): boolean source

check if ctx has changed

Params:

NameTypeAttributeDescription
last Context

the last COntext

Return:

boolean

public get(path: string | JSONPointer, toJS: boolean): any source

get value from state

Params:

NameTypeAttributeDescription
path string | JSONPointer

= '' - pointer to value

toJS boolean

= false - unbox value?

Return:

any

value

public update(patchSet: *): * source

Params:

NameTypeAttributeDescription
patchSet *

Return:

*