ref

Package Version Hex Docs

gleam add ref
import ref

pub fn main() {
  let myref = cell(0)
  io.debug(get(myref))
  // -> 0

  set(myref, get(myref) + 1)
  set(myref, get(myref) + 1)
  set(myref, get(myref) + 1)

  io.debug(get(myref))
  // -> 3
}

Further documentation can be found at https://hexdocs.pm/ref.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell
Search Document