Skip to content
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

withTargetValue #1

Closed
himynameisdave opened this issue Mar 4, 2019 · 1 comment
Closed

withTargetValue #1

himynameisdave opened this issue Mar 4, 2019 · 1 comment
Assignees

Comments

@himynameisdave
Copy link
Owner

Description

A utility that grabs the event.target.value (if it exists) and passes it along as the first argument to the provided function, followed by the full event object.

Sample usage:

import { withTargetValue } from 'browser-event-utils';

const input = document.querySelector('input');
input.addEventListener('change', withTargetValue((value, event) => {
    console.log(`The value is ${value}`)
}));
@himynameisdave himynameisdave self-assigned this Mar 4, 2019
@himynameisdave
Copy link
Owner Author

Done by d49ea23

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

No branches or pull requests

1 participant