Skip to main content
Module

x/dendron_exports/deps/micromark.ts>State

Export your Dendron vault into SSG compatible markdown
Go to Latest
type alias State
import { type State } from "https://deno.land/x/dendron_exports@v0.1.2/deps/micromark.ts";

The main unit in the state machine: a function that gets a character code and has certain effects.

A state function should return another function: the next state-as-a-function to go to.

But there is one case where they return void: for the eof character code (at the end of a value). The reason being: well, there isn’t any state that makes sense, so void works well. Practically that has also helped: if for some reason it was a mistake, then an exception is throw because there is no next function, meaning it surfaces early.

definition: (code: Code) => State | void