Contents

init(newPromiseResolvedWithResult:in:)

Creates a resolved promise object with the specified value.

Declaration

init!(newPromiseResolvedWithResult result: Any!, in context: JSContext!)

Parameters

  • result:

    The result value to pass to any reactions.

  • context:

    The Jscontext the resulting Jsvalue belongs to.

Return Value

A JSValue that represents a new promise JavaScript object.

Discussion

This method is equivalent to calling the following:

[JSValue valueWithNewPromiseFromExecutor:^(JSValue *resolve, JSValue *reject) { 
    [resolve callWithArguments:@[result]]; 
} inContext:context];

See Also

Creating JavaScript Values