Skip to content

Commit 01aea9d

Browse files
authored
Update README.md
1 parent f35455b commit 01aea9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ observer.reset(); // removes observer from event
2424
lars::ObservableValue a = 1;
2525
lars::ObservableValue b = 2;
2626
lars::DependentObservableValue sum([](auto a, auto b){ return a+b; },a,b);
27-
sum.onChange.connect([](auto &v){ std::cout << "The result is " << r << std::endl; });
28-
a.set(3); // -> "The result is 5"
27+
sum.onChange.connect([](auto &v){ std::cout << "The result changed to " << r << std::endl; });
28+
std::cout << "The result is " << *sum << std::endl; // -> the result is 3
29+
a.set(3); // -> The result changed to 5
2930
```
3031

3132
# Installation and usage

0 commit comments

Comments
 (0)