Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OptionalSerializer<T>

Serializes Optional<T> using a serializer for T. This is slightly more efficient than DefaultSerializer, and it works with arbitrary T.

Construct using getInstance.

Type Parameters

  • T

Hierarchy

  • OptionalSerializer

Implements

Index

Methods

  • deserialize(message: Uint8Array): Optional<T>
  • Inverse of serialize.

    Typically, this returns a deep clone of the original value, not the same literal reference. Indeed, it is impossible to return the original reference on a different replica.

    Parameters

    • message: Uint8Array

    Returns Optional<T>

  • serialize(value: Optional<T>): Uint8Array

Generated using TypeDoc