danprince / zaphod

🌌 Clojure's API for JavaScript's Objects
https://zaphod.surge.sh
MIT License
54 stars 1 forks source link

Consider atom type #7

Closed danprince closed 8 years ago

danprince commented 8 years ago

Consider including a port for Clojure's atom type.

import { atom, swap, reset, watch } from 'zaphod';

const counter = atom(0);

counter::watch(n => console.log(n));

counter::swap(inc)
// log "1"

counter::reset(-1)
// log "-1"