open-index/open-npm huggingface dataset:
npm package: @nathanfaucett/atom
Description: clojure like atom for the browser and node.js
Author: Nathan Faucett
Latest version: 0.0.2

Atom
=======

clojure like atom for the browser and node.js

```javascript
var Atom = require("@nathanfaucett/atom");


var atom = Atom({
  key: null
});

atom.addListener(function onChange(prev, next) {
  // use prev and next state
});

atom.update(function update(current) {
  return {
    key: "value"
  }
});
console.log(atom.get()); // { key: "value" }

atom.set({
  key: null
});
console.log(atom.get()); // { key: null }


```