Skip to content

Add event detail - eventType to 'remote-input-success' customEvent #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Apr 8, 2024

Conversation

kendallgassner
Copy link
Contributor

@kendallgassner kendallgassner commented Mar 28, 2024

What

We need to announce the number of results when a remote-input has finished fetching results. This announcement should only happen on input change and therefore I need to know what triggered the 'remote-input-success' customEvent.

Pairing with @TylerJDev to fix broken karma setup, ensure successful tests runs, and create a workflow to run the tests on PRs. He graciously offered to work on this pr as I became swamped on Thursday!

@kendallgassner kendallgassner requested a review from a team as a code owner March 28, 2024 16:17
@kendallgassner
Copy link
Contributor Author

I was having trouble running testing locally due to dependencies being so old. I will keep trying locally but I was hoping the tests ran in the PR 😭

src/index.ts Outdated
const fetch = fetchResults.bind(null, this, true)
const state = {currentQuery: null, oninput: debounce(fetch), fetch, controller: null}
const fetch = (e: Event) => fetchResults.bind(null, this, true, e)
const state = {currentQuery: null, oninput: (e: Event) => debounce(fetch(e)), fetch, controller: null}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would be better:

Suggested change
const state = {currentQuery: null, oninput: (e: Event) => debounce(fetch(e)), fetch, controller: null}
const state = {currentQuery: null, oninput: debounce((e: Event) => fetch(e)), fetch, controller: null}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point!

@kendallgassner
Copy link
Contributor Author

kendallgassner commented Mar 29, 2024

The PR to update linting and add it to the workflow that runs on pull requests:

@kendallgassner kendallgassner requested a review from jonrohan April 8, 2024 15:34
@kendallgassner
Copy link
Contributor Author

I am not authorized to merge this pull-request. Not sure if only Primer can... but this is good to go!

Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

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

Seems good, only curious about the eslint dependency

- name: Run build
run: npm run build
- name: Run test
run: npm run test
Copy link
Member

Choose a reason for hiding this comment

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

can't believe we weren't doing this already 🤦🏻

@@ -23,14 +22,12 @@
"devDependencies": {
"chai": "^4.1.2",
"chromium": "^3.0.3",
"eslint": "^6.8.0",
"eslint-plugin-github": "^3.4.1",
Copy link
Member

Choose a reason for hiding this comment

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

Did we loose eslint?

Copy link
Member

Choose a reason for hiding this comment

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

ah never mind, found the update pr 👍🏻

Copy link
Contributor Author

@kendallgassner kendallgassner Apr 8, 2024

Choose a reason for hiding this comment

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

Good q @jonrohan! These will be added back in #35

Copy link
Contributor Author

@kendallgassner kendallgassner Apr 8, 2024

Choose a reason for hiding this comment

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

Also, I am not authorized to merge so feel free to merge whenever.

@jonrohan jonrohan merged commit af06374 into main Apr 8, 2024
@jonrohan jonrohan deleted the kendallg/add-event-detail-eventType branch April 8, 2024 16:44
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.

4 participants