acarabott / atom-cpp

A basic "Atom" implementation inspired by thi.ng/atom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Atom C++

A very basic and incomplete implementation of the Atom/Cursor state model found in thi.ng/atom TypeScript package (which is in turn based on Clojure's Atom).

This is just to illustrate the concept, and some of the challenges of implementing something similar in C++.

The general idea is to have your application state stored in a single place, and to use a wrapper for access and updates. When accessing state with get, the returned values are immutable, the only way to modify your application state is to use the set or update methods.

Atoms can be subscribed to with a function that will be called whenever changes are occur.

Cursors provide read/write/subscription to a single value of the state.

History is used to keep track of all state changes, and restore previous states.

Authors

  • Arthur Carabott

About

A basic "Atom" implementation inspired by thi.ng/atom

License:MIT License


Languages

Language:C++ 97.2%Language:CMake 2.8%