etch/stdout

This module provides a way to queue and flush commands.

import stdout.{Queue, queue, flush}

let q = Queue([])
queue(q, [
  EnterRaw,
  EnterAlternativeScreen,
  HideCursor,
  Println("Hello from Etch"),
])
flush(q)

Types

Queue for the Commands to flush.

pub type Queue {
  Queue(commands: List(command.Command))
}

Constructors

Values

pub fn execute(commands: List(command.Command)) -> Nil

Flushes Commands without queueing them beforehand.

pub fn flush(queue: Queue) -> Queue

Flushes the Queue.

pub fn queue(
  queue: Queue,
  commands: List(command.Command),
) -> Queue

Adds Commands to the Queue.

Search Document