arximboldi / lager

C++ library for value-oriented design using the unidirectional data-flow architecture — Redux for C++
https://sinusoid.es/lager/
MIT License
704 stars 66 forks source link

Implement watchable_base::unbind() #171

Closed dimula73 closed 1 year ago

dimula73 commented 1 year ago

It turned out that there was no way to unbind anything from a reader after once bound. Assignment operator keeps all the binding untouched (which looks a bit strange, but "by design"), so we need a separate method to unbind everything when needed.

codecov-commenter commented 1 year ago

Codecov Report

Merging #171 (1b5938c) into master (24887ac) will increase coverage by 0.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #171      +/-   ##
==========================================
+ Coverage   94.30%   94.34%   +0.03%     
==========================================
  Files          80       80              
  Lines        2616     2651      +35     
==========================================
+ Hits         2467     2501      +34     
- Misses        149      150       +1     
Impacted Files Coverage Δ
lager/watch.hpp 100.00% <100.00%> (ø)
test/watchers.cpp 100.00% <100.00%> (ø)
lager/context.hpp 88.23% <0.00%> (-2.68%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

arximboldi commented 1 year ago

LGTM.

Agree current connection semantics, while convenient for some use-cases, have some surprising cases. Been thinking about changing them for a while, to something a bit more explicit when it comes to lifetimes.