Skip to content

v0.1.18

Choose a tag to compare

@github-actions github-actions released this 26 Sep 11:50
· 24 commits to main since this release
e84ef12

Added

  • Non-blocking and real-time execution (#11):
    • await sim.runAsync({ until?, batchSize?, signal? }) processes events in batches and yields to the event loop between them, so browser pages and servers stay responsive. Same result as run().
    • sim.runRealtime({ factor?, until? }) paces events to wall-clock time (factor = seconds per simulation unit) and returns a handle with pause(), resume(), stop(), setFactor(), isPaused, isActive and a done promise.
    • New 'progress' lifecycle event with { now, eventsProcessed, eventsInQueue }, emitted after every batch (async) or every event (real time).
    • Calling run(), runAsync() or runRealtime() while another run is in flight throws.
    • New exported types RunAsyncOptions, RealtimeOptions, RealtimeHandle, ProgressInfo.
  • The React integration guide shows a play/pause/speed control built on runRealtime.