EditorState
semagrams.EditorState
class EditorState(val elt: SvgElement, dispatcher: Dispatcher[IO], val eventQueue: Queue[IO, Event])
This is the main state for Semagrams.
Even though we call this "state", notice that everything here is actually immutable. The state itself is all stored in Laminar stuff, like Vars and EventBuses.
We pass in dispatcher
and eventQueue
because this constructor can't run
in IO, and thus can't make them itself. It can however use the dispatcher
to attach the EventBus of events to the queue.
Attributes
- dispatcher
An IO dispatcher, used to bind the EventBus of events to
eventQueue
.- elt
The main svg element of the semagram.
- eventQueue
A queue to use for events. We might also throw things into this queue for testing purposes.
- Graph
- Supertypes
- class Objecttrait Matchableclass Any