Add a new action at the end of the new observable that is returned.
More...
Go to the source code of this file.
|
template<class... AN> |
auto | rxcpp::operators::finally (AN &&... an) -> operator_factory< final ly_tag |
| Add a new action at the end of the new observable that is returned. More...
|
|
Add a new action at the end of the new observable that is returned.
- Template Parameters
-
LastCall | the type of the action function |
- Parameters
-
- Returns
- Observable that emits the same items as the source observable, then invokes the given action.
- Sample Code
finally([](){
printf("The final action\n");
});
values.
[](int v){printf("OnNext: %d\n", v);},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 2
OnNext: 3
OnCompleted
The final action
If the source observable generates an error, the final action is still being called: finally([](){
printf("The final action\n");
});
values.
[](int v){printf("OnNext: %d\n", v);},
},
[](){printf("OnCompleted\n");});
OnNext: 1
OnNext: 2
OnNext: 3
OnError: Error
from source
The final action
◆ RXCPP_OPERATORS_RX_FINALLY_HPP
#define RXCPP_OPERATORS_RX_FINALLY_HPP |