From 29dc561735c764c8995d101425a7bcfab483fd09 Mon Sep 17 00:00:00 2001 From: Paddy Mullen Date: Wed, 4 Jan 2023 11:34:59 -0500 Subject: [PATCH 1/3] WIP on what a simple event should look like --- examples/workbooks/xdk-simple-deploy.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/examples/workbooks/xdk-simple-deploy.ts b/examples/workbooks/xdk-simple-deploy.ts index 7df143a..8eb17bf 100644 --- a/examples/workbooks/xdk-simple-deploy.ts +++ b/examples/workbooks/xdk-simple-deploy.ts @@ -41,10 +41,22 @@ const TestSheet = new Sheet( } ) -export default new Workbook({ +const WB = new Workbook({ name: 'Sheet from SDK', namespace: 'xdk-test', sheets: { TestSheet, }, }) + + +export class BulkAction implements Mountable { + + public listenOn = [WB, "bulkEventName"] + + public respond(ev:Event) { + + } +} + + export default WB; From 7f89072e8964f67711aae035f386be4c3a20993f Mon Sep 17 00:00:00 2001 From: Paddy Mullen Date: Wed, 4 Jan 2023 11:36:51 -0500 Subject: [PATCH 2/3] WIP --- examples/workbooks/xdk-simple-deploy.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/workbooks/xdk-simple-deploy.ts b/examples/workbooks/xdk-simple-deploy.ts index 8eb17bf..1bc5cb0 100644 --- a/examples/workbooks/xdk-simple-deploy.ts +++ b/examples/workbooks/xdk-simple-deploy.ts @@ -50,13 +50,17 @@ const WB = new Workbook({ }) -export class BulkAction implements Mountable { +//I would expect that BulkAction gets deployed somehow +export class BulkAction implements Mountable { + //What object to listen on, what event name to listen too public listenOn = [WB, "bulkEventName"] public respond(ev:Event) { - + //many event body } } +//do we have to add BulkAction to WB. How do we make sure that BulkAction gets deployed? + export default WB; From 0ed3ec04cfc1ec032f307551dee751d4c8f9d8c8 Mon Sep 17 00:00:00 2001 From: Paddy Mullen Date: Wed, 4 Jan 2023 11:51:52 -0500 Subject: [PATCH 3/3] WIP --- examples/workbooks/xdk-simple-deploy.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/examples/workbooks/xdk-simple-deploy.ts b/examples/workbooks/xdk-simple-deploy.ts index 1bc5cb0..c2eee24 100644 --- a/examples/workbooks/xdk-simple-deploy.ts +++ b/examples/workbooks/xdk-simple-deploy.ts @@ -51,8 +51,12 @@ const WB = new Workbook({ +// so I don't want mountable, because I want BulkAction to end up in the same space that has WB +//export class BulkAction implements Mountable { + + //I would expect that BulkAction gets deployed somehow -export class BulkAction implements Mountable { +export class BulkAction implements EventHandler { //What object to listen on, what event name to listen too public listenOn = [WB, "bulkEventName"] @@ -61,6 +65,15 @@ export class BulkAction implements Mountable { } } +const ba = new BulkAction() +ba.on([EventTopic.BulkActionName], (e) => { + ba.respond(e); +} + ) + //do we have to add BulkAction to WB. How do we make sure that BulkAction gets deployed? +//How do we make sure that BulkAction ends up in the same SpaceConfig with WB + + export default WB;