event-sourcing-with-svelte Svelte Themes

Event Sourcing With Svelte

This is a basic experiment with Svelte and event sourcing.

Borrowing naming from Elm:

Events -> Update -> Model -> View

User interaction fires events, which are reduced into a model state, and the view is a function of this state.

Implementation

For each component

  • events.ts store the event types that can be published.
  • reducer.ts creates an instance of createEventSourcedState, which links events to the reducer and populates the state.
  • {Component}.svelte creates a view based on the state, and any user interactions publish events to the event store.

Installing

Install node with mise install Activate mise shell with eval "$(mise activate)" npm run install

Running

npm run dev

Top categories

Loading Svelte Themes