📄️ Rooms
The primary unit of collaboration within a Syncosaurus application is the room, a central coordination point and data store location. Much like a physical meeting room may serve as a hub for multiple individuals to communicate and exchange information and ideas, a room in Syncosaurus serves as a hub for users of a collaborative application (known as clients) to share updates and access the same data. In both scenarios, any update sent by any individual within a room may be received by all individuals present within the room, and any individual in the room also has access to the room's shared data (assuming they have permission to do so.) As with an individual moving in the physical world, a client in a collaborative web application can also move between different rooms, which often has its own features and rules.
📄️ Transactions
A transaction represents a single client update.
📄️ Mutators
A mutator is a Javascript function, defined by the developer, that transforms the shared application state through a transaction. A key feature of mutators is that they run twice:
📄️ Subscriptions
A subscription allows clients to monitor if and when changes occur to the shared state of a room, regardless if the source of a change is local or from the authoritative server.
📄️ Presence
As its name implies, presence allows for information on connected clients to be broadcast. Data like who is currently connected in a room, where each client's cursor is in the app, or the latest status update for each client are "ephemeral", lasting only as long as that client is connected. Thus, since this data is by definition temporary, these updates should be treated differently from client updates that may affect the shared application state. Presence data is effectively received, possibly transformed, and then immediately broadcasted.