Skip to content

Robert4S/gleam_ref

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ref

Package Version Hex Docs

gleam add ref
import ref

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

  ref.set(myref, fn(a) { a + 1 })
  ref.set(myref, fn(a) { a + 1 })
  ref.set(myref, fn(a) { a + 1 })

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

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published