Skip to content

FP version? #32

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

Open
ettebjorn opened this issue Mar 10, 2025 · 0 comments
Open

FP version? #32

ettebjorn opened this issue Mar 10, 2025 · 0 comments

Comments

@ettebjorn
Copy link

This would be so much more usable for me if you could provide a functional style friendly wrapper.

It would be very simple to do this. Basically provide some parallel version import { get } from 'get-value/fp', where:

  • Argument order is reversed.
  • The function is curried.

Perhaps separate get from getWithOptions. Examples of usage:

import { get, getWithOptions } from 'get-value/fp'

const getValue = get('event.target.value');
const value = getValue(message);
// Would be the same as:
const value = get('event.target.value', message);
// or, trivially:
const value = get('event.target.value')(message);

// A "with options" version:
const get = getWithOptions({ isValid: ... });
const getValue = get('event.target.value');
const value = getValue(message);
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