Title

Global

Methods

# createState(name) → {State}

Creates a state with a given name, the state is created unbound
Parameters:
Name Type Description
name string a name for the state

View Source observable-state.js, line 76

State
Example
const state = createState("global")
const {Bind, bind} = state
const Input = bind({component: <TextField variant="outlined"/>})
const stateObject = {title: "global"}

function App() {
    return <Bind target={stateObject}>
        <Inner/>
    </Bind>
}

function Inner() {
    return <div>
        <Input property="title" label="title"/>
        <Input property="somethingElse" label="other" defaultValue=""/>
    </div>
}

# Setter(value)

Parameters:
Name Type Description
value any the value to set

View Source observable-state.js, line 416

Type Definitions

# ChangeEvent(target)

Used to notify of events
Parameters:
Name Type Description
target object the target that has been changed

View Source observable-state.js, line 632

# Extractor(event) → {any}

Parameters:
Name Type Description
event any the parameter of the event handler

View Source observable-state.js, line 45

the extracted value
any

# HandlePreparer(handlers)

Parameters:
Name Type Description
handlers Array.<function()> the handlers being used

View Source emitter.js, line 30

an updated array or the original array sorted

# TransformValue(value) → {any}

Parameters:
Name Type Description
value any the value to be transformed

View Source observable-state.js, line 39

the transformed value
any