Skip to content

FP version? #32

@ettebjorn

Description

@ettebjorn

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions