Skip to content

Enable custom predicates for replay triggers#1385

Merged
waltjones merged 1 commit into
masterfrom
waltjones/trigger-predicate-fn
Oct 15, 2025
Merged

Enable custom predicates for replay triggers#1385
waltjones merged 1 commit into
masterfrom
waltjones/trigger-predicate-fn

Conversation

@waltjones

Copy link
Copy Markdown
Contributor

Description of the change

Enables custom (user defined) predicate functions for replay triggers. For a given trigger definition, if the other conditions match, the trigger and context are passed to the predicate function, which returns true or false.

Example:

const predicateFn = (trigger, context) => {
  // custom logic to decide whether to capture replay
  return bool;
};

triggers: [
  {
    type: 'navigation',
    pathMatch: /settings/,
    predicateFn: predicateFn,
  },
]

Type of change

  • New feature (non-breaking change that adds functionality)

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

@matux matux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome!

@waltjones waltjones merged commit 51d35ee into master Oct 15, 2025
6 checks passed
@waltjones waltjones deleted the waltjones/trigger-predicate-fn branch October 15, 2025 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants