then<R> method
Synchronously transform the resolved value. Returns a new NitroPromise<R>.
Mirrors Promise<T>::then<R>(fn) in RN Nitro.
Implementation
NitroPromise<R> then<R>(R Function(T) transform) {
final next = NitroPromise<R>();
_completer.future.then(
(v) => next.resolve(transform(v)),
onError: (e, s) => next.reject(e, s),
);
return next;
}