Class Awareness<T>

Awareness is a structure that allows to track the ephemeral state of the peers.

If we don't receive a state update from a peer within the timeout, we will remove their state. The timeout is in milliseconds. This can be used to handle the off-line state of a peer.

Type Parameters

Constructors

  • Type Parameters

    Parameters

    • peer: `${number}`
    • Optionaltimeout: number

    Returns Awareness<T>

Properties

Methods

  • Parameters

    Returns void

  • Parameters

    • bytes: Uint8Array
    • Optionalorigin: string

    Returns void

  • Returns void

  • Parameters

    • peers: `${number}`[]

    Returns Uint8Array

  • Returns Uint8Array

  • Returns Record<`${number}`, T>

  • Returns T

  • Returns `${number}`[]

  • Parameters

    Returns void

  • Parameters

    • state: T

    Returns void