@getstrata/core 2.2.31 → 2.2.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -306,6 +306,20 @@ async function dispatchQueuedModelEvents(queued) {
306
306
  }
307
307
  }
308
308
  }
309
+ async function dispatchModelEvent(event, payload) {
310
+ await eventBus.dispatchTransactional(event, payload);
311
+ const state = deferredModelEvents.getStore();
312
+ const frame = state?.frames[state.frames.length - 1];
313
+ if (frame) {
314
+ frame.push({
315
+ event,
316
+ payload,
317
+ tenant: currentTenant()
318
+ });
319
+ return;
320
+ }
321
+ await eventBus.dispatch(event, payload);
322
+ }
309
323
  async function runWithDeferredModelEvents(callback) {
310
324
  const existing = deferredModelEvents.getStore();
311
325
  if (existing) {
@@ -691,6 +691,20 @@ async function dispatchQueuedModelEvents(queued) {
691
691
  }
692
692
  }
693
693
  }
694
+ async function dispatchModelEvent(event, payload) {
695
+ await eventBus.dispatchTransactional(event, payload);
696
+ const state = deferredModelEvents.getStore();
697
+ const frame = state?.frames[state.frames.length - 1];
698
+ if (frame) {
699
+ frame.push({
700
+ event,
701
+ payload,
702
+ tenant: currentTenant()
703
+ });
704
+ return;
705
+ }
706
+ await eventBus.dispatch(event, payload);
707
+ }
694
708
  async function runWithDeferredModelEvents(callback) {
695
709
  const existing = deferredModelEvents.getStore();
696
710
  if (existing) {
@@ -306,6 +306,20 @@ async function dispatchQueuedModelEvents(queued) {
306
306
  }
307
307
  }
308
308
  }
309
+ async function dispatchModelEvent(event, payload) {
310
+ await eventBus.dispatchTransactional(event, payload);
311
+ const state = deferredModelEvents.getStore();
312
+ const frame = state?.frames[state.frames.length - 1];
313
+ if (frame) {
314
+ frame.push({
315
+ event,
316
+ payload,
317
+ tenant: currentTenant()
318
+ });
319
+ return;
320
+ }
321
+ await eventBus.dispatch(event, payload);
322
+ }
309
323
  async function runWithDeferredModelEvents(callback) {
310
324
  const existing = deferredModelEvents.getStore();
311
325
  if (existing) {
@@ -239,6 +239,20 @@ async function dispatchQueuedModelEvents(queued) {
239
239
  }
240
240
  }
241
241
  }
242
+ async function dispatchModelEvent(event, payload) {
243
+ await eventBus.dispatchTransactional(event, payload);
244
+ const state = deferredModelEvents.getStore();
245
+ const frame = state?.frames[state.frames.length - 1];
246
+ if (frame) {
247
+ frame.push({
248
+ event,
249
+ payload,
250
+ tenant: currentTenant()
251
+ });
252
+ return;
253
+ }
254
+ await eventBus.dispatch(event, payload);
255
+ }
242
256
  async function runWithDeferredModelEvents(callback) {
243
257
  const existing = deferredModelEvents.getStore();
244
258
  if (existing) {