feat(shared): base event setup
Compare changes
Files
7
apps/shared/src/events/events.spec.ts
0 → 100644
+ 29
− 0
Created a new event structure which is basically the following:
type BaseEvent<T extends Record<string, unknown>> = {
id: string, // UUID
timestamp: Date, // new Date() on construction
type: string, // class name
data: T // The data payload
}
Sadly I could not use pure types as reflection is not the best yet in TypeScript so this will do. Creating new Events is quite easy as can be seen in the EventDidcommConnectionsGetAll
class.
Copyright © Eclipse Foundation, Inc. All Rights Reserved. Privacy Policy | Terms of Use | Copyright Agent