The data manager this mutation applies to
Optional deletes?: string[]Keys to remove from the data manager.
Optional increments?: { Key-value pairs to increment in the data manager. The values are the amount to increment by (can be negative).
Optional updates?: { Key-value pairs to set in the data manager. These will overwrite existing values.
// Setting values
const setMutation: DataManagerMutation = {
dataManagerId: { id: "gameState" },
updates: {
score: 100,
level: 5,
gameActive: true
}
};
// Deleting values
const deleteMutation: DataManagerMutation = {
dataManagerId: { id: "player_123" },
deletes: ["powerup", "shield"]
};
// Incrementing values
const incrementMutation: DataManagerMutation = {
dataManagerId: { id: "player_123" },
increments: { score: 10, lives: -1 }
};
Represents a batch of changes to a DataManager.
Mutations are sent from clients to the server or from the server to clients to keep all data managers synchronized.