# Operation

```ts
interface Operation<T>
```

An `Operation` in Effection describes an abstract computation. An operation
does not do anything on its own. Rather, it only describes the steps it will
take when it runs.

In the Effection world, `Operation` occupies the same position as `Promise`
does the world of async/await.

An operation can be created with a generator function that only does `yield*`
to other operations:

### Examples
#### Example 1
```javascript
import { sleep } from "effection";

function* slow5(seconds) {
  yield* sleep(seconds * 1000);
  return 5;
}
```

Operations can also be created using `Symbol.iterator`. The following
operation is the same as above:

---
#### Example 2
```javascript
import { sleep } from "effection";

const slow5 = (seconds) => ({
  *[Symbol.iterator]() {
    yield* sleep(seconds * 1000);
    return 5;
  }
})
```

See [Operations guide](https://frontside.com/effection/docs/operations) for more information.
---


### Type Parameters
T


### Methods
<dl>
<dt class="border-dotted [&:not(:first-child)]:border-t-2 [&:not(:first-child)]:pt-3 [&:not(:first-child)]:mt-2"><h4 id="[Symbol.iterator]" class="inline scroll-mt-[100px]">[Symbol.iterator]</h4>(): Iterator&lt;Instruction, T, any&gt;</dt>
<dd class="flex flex-col [&>pre]:mb-3 [&>p:not(:first-child)]:mt-0" >
*No documentation available.*
</dd>
</dl>

[View code](https://github.com/thefrontside/effection/tree/effection-v3.6.1/lib/types.ts#L43)
