MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / RegisterCallbacks

Function RegisterCallbacks

templates/chat-console-cs/Program.cs:88–97  ·  view source on GitHub ↗
(DbConnection conn)

Source from the content-addressed store, hash-verified

86
87/// Register all the callbacks our app will use to respond to database events.
88void RegisterCallbacks(DbConnection conn)
89{
90 conn.Db.User.OnInsert += User_OnInsert;
91 conn.Db.User.OnUpdate += User_OnUpdate;
92
93 conn.Db.Message.OnInsert += Message_OnInsert;
94
95 conn.Reducers.OnSetName += Reducer_OnSetNameEvent;
96 conn.Reducers.OnSendMessage += Reducer_OnSendMessageEvent;
97}
98
99/// If the user has no set name, use the first 8 characters from their identity.
100string UserNameOrIdentity(User user) => user.Name ?? user.Identity.ToString()[..8];

Callers 2

MainFunction · 0.85
BeginPlayMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…