FastLED 3.9.15
Loading...
Searching...
No Matches

◆ then()

template<typename T>
promise & fl::promise< T >::then ( fl::function< void(const T &)> callback)
inline

Register success callback - returns reference for chaining.

Parameters
callbackFunction to call when promise resolves successfully
Returns
Reference to this promise for chaining

Definition at line 129 of file promise.h.

129 {
130 if (!valid()) return *this;
131
132 mImpl->set_then_callback(fl::move(callback));
133 return *this;
134 }
bool valid() const
Check if promise is valid.
Definition promise.h:122
fl::shared_ptr< detail::PromiseImpl< T > > mImpl
Shared pointer to implementation - this allows copying and sharing promise state.
Definition promise.h:223
Promise class that provides fluent .then() and .catch_() semantics This is a lightweight wrapper arou...
Definition promise.h:72

References promise(), mImpl, fl::move(), and valid().

+ Here is the call graph for this function: