# Subscribe

`function` in `core` · v0.12.0

<https://seedcord.org/docs/packages/core/0.12.0/functions/subscribe>

Registers a subscriber class with one or more subscription keys.

Supply one `[key, options?]` tuple per key. The subscriber's generic must list the same keys.

```ts
Subscribe<Defs>(
    defs: Defs
): <
    HandlerCtor extends Constructor<
        Subscriber<Defs[number][0], CoreBase>
    >
>(
    constructor: HandlerCtor
) => void
```

Registers a subscriber class with one or more subscription keys.

Supply one `[key, options?]` tuple per key. The subscriber's generic must list the same keys.

Parameters.

- `defs` `Defs`

Returns `<HandlerCtor extends Constructor<Subscriber<Defs[number][0], CoreBase>>>(constructor: HandlerCtor) => void`.
