Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow skipping a callback when reforming (#2864)
* Allow skipping a callback when reforming This adds a method to the callback, similar to Rust's filter_map, which allows to reform a callback, but also suppress the emit in case the reform function returns `None`. * Update packages/yew/src/callback.rs Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com> * Implement filter_reform for all Callback output types As suggested in the PR, this implements filter_reform for all output types of callbacks by mapping to `Option<OUT>`. * Fix clippy error Although I believe that the code is more readable/understandable with an explicit map, I am not sure adding a clippy exception just for that is justified. So I applied the clippy suggestion. Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>
- Loading branch information