1.0.4 • Published 5 years ago

@reverse/callback v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@reverse/callback

Little callbacks you can use to work faster.

I wrote these since I was tired of repeating some of the same code, so I threw these little things in a helper function package.

You can install with nodejs and npm

npm i @reverse/callback

Table of Contents**

identity

Returns the passed argument.

export const identity = (x) => x;

Calls the passed argument.

export const call = (x) => x();

Useful for calling everything in an array: functionArray.forEach(call);

propEquals generator

Creates a callback for if the passed argument's property equals a certain value.

const propEquals = (prop, value) => (item) => item[prop] === value;

Useful for finding an item in an array using .find() array.find(propEquals('name', 'dave'));

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago