Class: ReactCursor

ReactCursor

new ReactCursor(object, component, stateKey)

A Cursor subclass that stores the underlying object in a React component's state.
Parameters:
Name Type Argument Default Description
object Object The underlying object.
component component A React.js component instance.
stateKey String <optional>
cursor The key to store in the component's state.

Extends

Members

changed

Whether or not there are un-flushed changes to this cursor.
Inherited From:

component

The component this cursor is associated with.

object

The underlying object of this cursor
Inherited From:

Methods

<static> build(object, component, stateKey) → {ReactCursor}

Create a ReactCursor instance, converting the given object to an immutable one.
Parameters:
Name Type Argument Default Description
object Object The underlying object.
component component A React.js component instance.
stateKey String <optional>
cursor The key to store in the component's state.
Returns:
Type
ReactCursor

equals(other) → {Boolean}

Compares this cursor to another and returns whether the two are equal.
Parameters:
Name Type Description
other Cursor The other cursor.
Inherited From:
Returns:
Type
Boolean

flush()

If this cursor has changed, then emit the 'change' event and set the changed flag back to false.
Inherited From:

refine(path)

Return a refinement of this cursor for the given path.
Parameters:
Name Type Argument Description
path String | Number <repeatable>
The path to refine.
Inherited From: