Skip to content

Mjkim-Programming/Mono

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mono

Mono is a C++ library that implements Observables based on template.

Key Features

  • Assign Watcher to notify set() or operator[] = value
  • Can detect state[key] = value using operator[] Proxy

Install & Build

$ git clone https://github.com/Mjkim-Programming/Mono
$ cd Mono

$ chmod +x ./install.sh
$ ./install.sh

Only supports linux for now. Do you want windows install script and do you thing that you can create it? Then please contribute!

Example

#include <mono/observable.hpp>
#include <iostream>

int main() {
    obs::Observable<int> obs;

    obs.watch([](const std::string& key, const int& value){
        std::cout << "Changed: " << key << " = " << value << "\n";
    });

    obs.set("a", 42);
    obs["b"] = 100;

    std::cout << obs.get("a") << "\n";   // 42
    std::cout << int(obs["b"]) << "\n";  // 100
}

Contributing

Contributions are welcome! There are no strict coding rules yet, so feel free to contribute. We’ll refine guidelines as the project grows.

About

C++ library that implements simple observables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published