# suspend

```ts
function suspend(): Operation<void>
```

Indefinitely pause execution of the current operation.

A suspended operation will remain paused until its enclosing scope
is destroyed, at which point it proceeds as though return had been
called from the point of suspension.

### Examples
#### Example 1
```js
import { main, suspend } from "effection";

await main(function* (resolve) {
  try {
    console.log('suspending');
    yield* suspend();
  } finally {
    console.log('done!');
  }
});
```

---
### Return Type


[Operation](https://frontside.com/effection/api/v4-next/Operation.md)&lt;void&gt;


an operation that suspends the current operation

[View code](https://github.com/thefrontside/effection/tree/effection-v4.2.0/lib/suspend.ts#L28)
