[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Types](https://evolu.dev/docs/api-reference/common/Types) › isPromiseLike

```ts
function isPromiseLike<T>(value: Awaitable<T>): value is PromiseLike<T>;
```

Defined in: [packages/common/src/Types.ts:256](https://github.com/evoluhq/evolu/blob/e7144e2bbe9069362b62dec1b64a8aa922b8f1b0/packages/common/src/Types.ts#L256)

Type guard to check if a value is a [PromiseLike](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables).

Use with [Awaitable](https://evolu.dev/docs/api-reference/common/Types/type-aliases/Awaitable) to conditionally `await` only when necessary,
avoiding microtask overhead for synchronous values.

### Example

```ts
const validate = (id: string): Awaitable<boolean> => {
  const cached = cache.get(id);
  if (cached !== undefined) return cached; // Sync path
  return fetchValidation(id); // Async path
};

const result = validate(id);
const isValid = isPromiseLike(result) ? await result : result;
```