2021-06-04 01:03:31 -05:00
|
|
|
import {Model} from '../Model'
|
2022-01-26 19:37:54 -06:00
|
|
|
import {BaseEvent} from '../../../support/bus'
|
|
|
|
|
import {Awaitable} from '../../../util'
|
2021-06-04 01:03:31 -05:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Base class for events that concern an instance of a model.
|
2022-01-26 19:37:54 -06:00
|
|
|
* @fixme support serialization
|
2021-06-04 01:03:31 -05:00
|
|
|
*/
|
2022-01-26 19:37:54 -06:00
|
|
|
export abstract class ModelEvent<T extends Model<T>> extends BaseEvent {
|
2021-06-04 01:03:31 -05:00
|
|
|
constructor(
|
2022-01-26 19:37:54 -06:00
|
|
|
public readonly instance: T,
|
2021-06-04 01:03:31 -05:00
|
|
|
) {
|
|
|
|
|
super()
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-26 19:37:54 -06:00
|
|
|
shouldBroadcast(): Awaitable<boolean> {
|
|
|
|
|
return false
|
2021-06-04 01:03:31 -05:00
|
|
|
}
|
|
|
|
|
}
|