So that's a (mostly) functional core built for the notes thing. It takes in commands and the current state of notes and generates events based on the command.
The ui listens for browser events, turns them into commands, and sends the commands to the core while waiting for the core to generate events for the ui to react to.
I'm starting work on a storage service that will listen for events and write them (or rather, the materialized states) to disk. It will also listen for events like to DOMContentLoaded
, and use that as a trigger to dispatch it's own (noteLoaded
) events via the core.
(I've just realised, when the UI makes a change, it can listen for a noteSaved
event to let the user know their change is safe).
'Disk' in the case will be browser local storage, I'm also planning a network service that will ship events to (and from) other machines (for things like offsite backup and shared context).
Should be fun.