@grabjs/superapp-sdk
    Preparing search index...

    Function hasResult

    • Type guard to check if a JSBridge response has a defined result (not null or undefined).

      Type Parameters

      Parameters

      • response: T

        The JSBridge response to check

      Returns response is Extract<T, { result: {} }>

      True if the response has a result that is neither null nor undefined, false otherwise

      const response = await someBridgeMethod();
      if (isSuccess(response) && hasResult(response)) {
      // response.result is guaranteed to be defined
      console.log('Result:', response.result);
      }