Package 

Interface Promise

    • Method Summary

      Modifier and Type Method Description
      abstract void resolve(@Nullable() Object value) Successfully resolve the Promise with an optional value.
      abstract void reject(String code, String message) Report an error without an exception using a custom code and error message.
      abstract void reject(String code, Throwable throwable) Report an exception with a custom code.
      abstract void reject(String code, String message, Throwable throwable) Report an exception with a custom code and error message.
      abstract void reject(Throwable throwable) Report an exception, with default error code.
      abstract void reject(Throwable throwable, WritableMap userInfo) Report an exception, with default error code, with userInfo.
      abstract void reject(String code, @NonNull() WritableMap userInfo) Reject with a code and userInfo WritableMap.
      abstract void reject(String code, Throwable throwable, WritableMap userInfo) Report an exception with a custom code and userInfo.
      abstract void reject(String code, String message, @NonNull() WritableMap userInfo) Report an error with a custom code, error message and userInfo, an error not caused by anexception.
      abstract void reject(String code, String message, Throwable throwable, WritableMap userInfo) Report an exception with a custom code, error message and userInfo.
      abstract void reject(String message) Report an error which wasn't caused by an exception.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • resolve

         abstract void resolve(@Nullable() Object value)

        Successfully resolve the Promise with an optional value.

        Parameters:
        value - Object
      • reject

         abstract void reject(String code, String message)

        Report an error without an exception using a custom code and error message.

        Parameters:
        code - String
        message - String
      • reject

         abstract void reject(String code, Throwable throwable)

        Report an exception with a custom code.

        Parameters:
        code - String
        throwable - Throwable
      • reject

         abstract void reject(String code, String message, Throwable throwable)

        Report an exception with a custom code and error message.

        Parameters:
        code - String
        message - String
        throwable - Throwable
      • reject

         abstract void reject(Throwable throwable)

        Report an exception, with default error code. Useful in catch-all scenarios where it's unclearwhy the error occurred.

        Parameters:
        throwable - Throwable
      • reject

         abstract void reject(Throwable throwable, WritableMap userInfo)

        Report an exception, with default error code, with userInfo. Useful in catch-all scenarioswhere it's unclear why the error occurred.

        Parameters:
        throwable - Throwable
        userInfo - WritableMap
      • reject

         abstract void reject(String code, @NonNull() WritableMap userInfo)

        Reject with a code and userInfo WritableMap.

        Parameters:
        code - String
        userInfo - WritableMap
      • reject

         abstract void reject(String code, Throwable throwable, WritableMap userInfo)

        Report an exception with a custom code and userInfo.

        Parameters:
        code - String
        throwable - Throwable
        userInfo - WritableMap
      • reject

         abstract void reject(String code, String message, @NonNull() WritableMap userInfo)

        Report an error with a custom code, error message and userInfo, an error not caused by anexception.

        Parameters:
        code - String
        message - String
        userInfo - WritableMap
      • reject

         abstract void reject(String code, String message, Throwable throwable, WritableMap userInfo)

        Report an exception with a custom code, error message and userInfo.

        Parameters:
        code - String
        message - String
        throwable - Throwable
        userInfo - WritableMap
      • reject

        @Deprecated() abstract void reject(String message)

        Report an error which wasn't caused by an exception.