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

◆ then()

template<typename T>
Promise & fl::task::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 115 of file promise.h.

115 {
116 if (!valid()) return *this;
117
118 mImpl->set_then_callback(fl::move(callback));
119 return *this;
120 }
fl::shared_ptr< detail::PromiseImpl< T > > mImpl
Shared pointer to implementation - this allows copying and sharing Promise state.
Definition promise.h:209
bool valid() const FL_NOEXCEPT
Check if Promise is valid.
Definition promise.h:108
Promise class that provides fluent .then() and .catch_() semantics This is a lightweight wrapper arou...
Definition promise.h:58

References Promise(), FL_NOEXCEPT, mImpl, fl::fl::move(), and valid().

+ Here is the call graph for this function: