Sync Primitives


Hamoni Sync stores your application state and handles notifying connected clients of state changes. The code you write tells Sync which of your application state to handle, and it does the rest to make sure clients are updated in real-time, even under network irregularity.

Sync primitives are what you use to define and manipulate state. Sync has three state primitives:

  1. Value: This kind of state holds simple information represented with datatypes like string, boolean or numbers. It is best suited for cases such as unread message count, toggles, etc.
  2. Object: Object state represents states that can be modelled in a single JSON object. An example usage could be storing the score of a game or score of a live match.
  3. List: This holds a list of state Object. You can update an item based on its index in the list. This can be used for real-time data table, charts, and data visualisation.

See the Usage section for a guide on how to manipulate state using these primitives.

results matching " "

    No results matching " "