# follow

function in `@dioramajs/diorama/kit`

```ts
import { follow } from '@dioramajs/diorama/kit'
```

Follows the pointer the way a light or a brush on an element wants it: a mouse or pen while it
is over the element, the first finger while it is pressed on it. Touch never blocks the page's
scroll: the browser takes the finger with `pointercancel` when one starts. Each change asks
for a frame. Listeners go with `ctx.signal`. Returns the live pointer; `on` adds callbacks.

```ts
function follow(
  ctx: Pick<EffectContext, 'element' | 'signal' | 'invalidate'>,
  on?: FollowHandlers,
): FollowedPointer
```

| Parameter | Type | Description |
| --- | --- | --- |
| `ctx` | `Pick<EffectContext, 'element' \| 'signal' \| 'invalidate'>` |  |
| `on?` | `FollowHandlers` |  |

Also exported from `@dioramajs/effects/kit`.

Defined in [packages/effects/src/kit.ts](https://github.com/MasterKurosava/diorama/blob/main/packages/effects/src/kit.ts#L356).
