feat(shared): base event setup
- Nov 27, 2023
-
-
Berend Sliedrecht authored
Signed-off-by:
Berend Sliedrecht <berend@animo.id>
b72698cc -
Berend Sliedrecht authored
Signed-off-by:
Berend Sliedrecht <berend@animo.id>
723712bb
-
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.
Signed-off-by:
Berend Sliedrecht <berend@animo.id>
Signed-off-by:
Berend Sliedrecht <berend@animo.id>
Copyright © Eclipse Foundation, Inc. All Rights Reserved. Privacy Policy | Terms of Use | Copyright Agent