Interface ReadonlyBinding<GetType>

The readonly interface for bindings

interface ReadonlyBinding<GetType> {
    addChangeListener: ((listener) => ChangeListenerRemover);
    get: (() => GetType);
    getChangeUid: (() => string);
    id: string;
    isBinding: true;
    isLocked: (() => boolean);
    isModified: (() => boolean);
    lock: (() => (() => void));
    triggerChangeListeners: (() => void);
    uid: string;
}

Type Parameters

  • GetType = any

Hierarchy (view full)

Properties

addChangeListener: ((listener) => ChangeListenerRemover)

Adds a listener that will be called when this binding changes.

Type declaration

See

useBindingEffect and BindingsConsumer

Returns

a function that may be used to remove the added listener.

get: (() => GetType)

Type declaration

Returns

the value

getChangeUid: (() => string)

Every time the value is changed, the change uid is updated

Type declaration

    • (): string
    • Every time the value is changed, the change uid is updated

      Returns string

id: string

A technical, but human-readable ID, which isn't guaranteed to be unique

isBinding: true

A marker indicating that this is a binding type

isLocked: (() => boolean)

Type declaration

    • (): boolean
    • Returns boolean

      true if the binding is locked

Returns

true if the binding is locked

isModified: (() => boolean)

Type declaration

    • (): boolean
    • Returns boolean

      true if this binding has been marked as being modified

Returns

true if this binding has been marked as being modified

lock: (() => (() => void))

Increments the lock count and returns a method to decrement it. A binding is locked if its lock count is > 0. When a binding is locked, mutating calls (reset/set/setRaw) won't have an immediate effect. However, if a mutating call is made on a locked binding, the change will be applied once the binding becomes unlocked.

Type declaration

    • (): (() => void)
    • Increments the lock count and returns a method to decrement it. A binding is locked if its lock count is > 0. When a binding is locked, mutating calls (reset/set/setRaw) won't have an immediate effect. However, if a mutating call is made on a locked binding, the change will be applied once the binding becomes unlocked.

      Returns (() => void)

      a function for decrementing this binding's lock count.

        • (): void
        • Returns void

Returns

a function for decrementing this binding's lock count.

triggerChangeListeners: (() => void)

Forcibly triggers the change listeners. Don't normally use this!

Type declaration

    • (): void
    • Forcibly triggers the change listeners. Don't normally use this!

      Returns void

uid: string

An ID that's unique to this runtime

Generated using TypeDoc