• Register all atoms to the server.

    Parameters

    • server: Server

      The server to register the atom model on.

    • props: RegisterAtomModelProps

      The properties to configure the atom model.

    Returns {
        unregister: (() => void);
        get(key): Atom;
        getKeys(): string[];
        set(key, atom): void;
    }

    An object with methods to unregister the model and to get and set atoms.

    • unregister: (() => void)

      Unregister the atom model from the server.

        • (): void
        • Unregister the atom model from the server.

          Returns void

    • get:function
      • Get an atom.

        Parameters

        • key: string

          The key of the atom to get.

        Returns Atom

        The atom.

    • getKeys:function
    • set:function
      • Sets an atom, which is immediately broadcast to all clients.

        Parameters

        • key: string

          The key of the atom to set.

        • atom: Atom

          The atom.

        Returns void