thefrontside / thefrontside/interactors

Support passing matcher to filter definition

Open
#23 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
36
Forks
2
Avg merge
4m
Merged PRs (30d)
2

Description

For some filters, we may want to provide a different matching experience by default. So that e.g. a className filter by default would match if one of the classes matches the given value. It would be cool if we could provide a matcher to use for this.

Note that with the current implementation, a Matcher is an already constructed value with a given value, so what we'd need is something like this:

type MatcherConstructor<T> = (value: T) => Matcher<T>;

Then:

createInteractor('element')
  .filters({
    className: {
      apply: (element) => elemnent.className,
      matcher: (value) => containsWord(value)
    }
  })

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the createInteractor filter-definition entry point and read the existing Matcher behavior. Trace how filter values are matched, then support a matcher constructor such as the proposed MatcherConstructor and verify that a className filter can use containsWord-style matching.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.