# Bus

`class` in `seedcord` · v0.12.0

<https://docs.seedcord.org/packages/seedcord/0.12.0/classes/bus>

Manages application subscribers and event handling

Provides a centralized system for registering and executing custom subscribers throughout the application lifecycle. Bus subscribers are loaded from configured directories and can be triggered programmatically or by framework events.

Accessed via core.bus, not directly instantiated

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `Bus` class.

```ts
class Bus extends Plugin<SubscriptionTuples>
```

## Properties

### pluggable

```ts
protected pluggable: Core
```

## Methods

### init

```ts
abstract async init(): Promise<void>
```

Initialize the plugin - implement setup logic here Override this method in your plugin classes

### onHmr

```ts
async onHmr(_event: HmrUpdateEvent): Promise<void>
```

Reloads plugin state on an HMR update.

### registerCriticalFiles

```ts
protected registerCriticalFiles(
    patterns: string[]
): void
```

Registers critical file patterns that should trigger a full restart when changed in Dev HMR.
