Add basic concepts for event bus, and implement in request and model
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-06-04 01:03:31 -05:00
parent dab3d006c8
commit 61731c4ebd
20 changed files with 375 additions and 52 deletions

11
src/event/Event.ts Normal file
View File

@@ -0,0 +1,11 @@
import {Dispatchable} from './types'
import {JSONState} from '../util'
/**
* Abstract class representing an event that may be fired.
*/
export abstract class Event implements Dispatchable {
abstract dehydrate(): Promise<JSONState>
abstract rehydrate(state: JSONState): void | Promise<void>
}