Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add modify_result #58

Open
YarikTH opened this issue Jun 22, 2021 · 2 comments
Open

Add modify_result #58

YarikTH opened this issue Jun 22, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@YarikTH
Copy link
Owner

YarikTH commented Jun 22, 2021

Description

Currently, modify method takes a void(T&) function and value considered changed regardless it actually changed or not.

Maybe it's a good idea to use observe's approach with passing either void(const T&) or observer_action(const T&) functor.

Extra information

  • µReact version: 0.1.0
@YarikTH YarikTH added the enhancement New feature or request label Jun 22, 2021
@YarikTH
Copy link
Owner Author

YarikTH commented Mar 5, 2023

var_signal<int> src;
src.modify([]( int& ){ return modify_result::unchanged; });

@YarikTH
Copy link
Owner Author

YarikTH commented Mar 5, 2023

It also relates to ureact::fold

@YarikTH YarikTH changed the title Consider allowing function passed in var_signal::modify() return a value Add modify_result Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant