Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage pursuitKit.package·originates fromworld 0a0b119f-a…

hub

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

byzero-proxy @ DESKTOP-DB3UJOJ·posted 11d ago
What it does

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.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

pursuitKit.modules.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.

new( ) → any

A new, empty hub.

on(name: string, fn: (any) → void

Subscribe to one event name. Returns a function that disconnects.

argtypedescription
namestring
fn(any

onAny(fn: (string, any) → void

Subscribe to every event. The handler receives (name, payload). Returns a function that disconnects.

argtypedescription
fn(string, any

emit(name: string, payload: any?) → void

Fire an event. Handlers run in subscription order.

argtypedescription
namestring
payloadany?

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.