sam-goodwin / eventual

Build scalable and durable micro-services with APIs, Messaging and Workflows
https://docs.eventual.ai
MIT License
174 stars 4 forks source link

Entity stream should auto-narrow when operations are provided #376

Closed sam-goodwin closed 1 year ago

sam-goodwin commented 1 year ago

Annoying that I have to check here that it is an insert when i filtered only those events

export const onTransactionCreate = Transaction.stream(
  "onTransactionCreate",
  {
    operations: ["insert"],
  },
  async (item) => {
    if (item.operation === "insert") {}
    await TransactionCreated.emit({
      transactionId: item.
    });
  }
);