onSave

val onSave: Facet<suspend (EditorSession) -> Unit, List<suspend (EditorSession) -> Unit>>

Facet that collects save handlers.

Each handler is called (in a coroutine on the session's scope) when the save command executes. Multiple handlers are all invoked — not just the first.

val ext = onSave.of { session ->
myViewModel.save(session.state.doc.toString())
}