segmentio / analytics-next

Segment Analytics.js 2.0
https://segment.com/docs/connections/sources/catalog/libraries/website/javascript
MIT License
402 stars 136 forks source link

Support adding middleware to every device mode destination #1053

Closed silesky closed 6 months ago

silesky commented 6 months ago

Add * glob support.

addDestinationMiddleware('*', ({ next, payload }) => {
  if (dropThisEventForSomeReason) {
     return null
  }
  next(payload)
})

[x] I've included a changeset

changeset-bot[bot] commented 6 months ago

🦋 Changeset detected

Latest commit: 286fb8a97e14a73ae99196569055001c067fb76c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------------------- | ----- | | @segment/analytics-next | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR