Log inGet started
World

Painted Metropolis

Branchmain
Commit1e1d3a3d4d

README.md

hub

A small event hub: named events, plain payload tables, no engine.

Every pursuitKit system reports what happened through a hub the host passes in, so animation, camera, sound and
UI subscribe to moments instead of polling state.

  local Hub = require("~.modules.hub")
  local hub = Hub.new()
  local off = hub:on("state", function(e) print(e.from, e.to) end)
  hub:emit("state", { from = "clear", to = "noticed" })
  off()                                  -- disconnect
  hub:onAny(function(name, e) ... end)   -- every event (a log, a recorder, a test)

A handler that errors does not stop the others; its message is kept in hub.lastError.

The interface is documented in the header of init.luau; this file repeats it for the asset browser.