Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLartians authored Apr 22, 2019
1 parent 0df68b0 commit 666e807
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

# lars::Event

A thread-safe C++11 event-listener template and observable value implementation.
A thread-safe event-listener template and observable value implementation for C++17.

# Example
# Examples

Full examples can be found in the [examples directory](https://github.com/TheLartians/Event/tree/master/examples).

## lars::Event

Expand All @@ -18,11 +20,11 @@ observer.reset(); // removes observer from event
## lars::ObservableValue
```c++
ObservableValue a = 1;
ObservableValue b = 2;
DependentObservableValue sum([](auto a, auto b){ return a+b; },a,b);
DependentObservableValue resultString([](auto v){ return "The result is " + std::to_string(v); }, sum);
resultString.onChange.connect([](auto &r){ std::cout << r << std::endl; });
lars::ObservableValue a = 1;
lars::ObservableValue b = 2;
lars::DependentObservableValue sum([](auto a, auto b){ return a+b; },a,b);
sum.onChange.connect([](auto &v){ std::cout << "The result is " << r << std::endl; });
a.set(3); // -> "The result is 5"
```

# Installation and usage
Expand Down

0 comments on commit 666e807

Please sign in to comment.