Skip to content

v0.5.0

Choose a tag to compare

@ryanhamamura ryanhamamura released this 06 Feb 19:47
· 49 commits to main since this release

What's New

Generic pub/sub helpers

  • via.Publish[T] and via.Subscribe[T] — typed wrappers that handle JSON marshaling over any via.PubSub backend
  • vianats.EnsureStream and vianats.ReplayHistory[T] — convenience functions for JetStream stream setup and message replay

Pubsub CRUD example (internal/examples/pubsub-crud)

  • Demonstrates CRUD operations with real-time DaisyUI toast notifications broadcast to all connected clients via NATS
  • Uses DataIgnoreMorph() to preserve active toasts across morphs
  • Self-filtering: clients don't see toasts for their own actions

Improvements

  • Refactored nats-chatroom example to use the new generic helpers, removing direct encoding/json and nats-io imports