# @sullux/fp-light-call

> A lightweight functional library for functional composition and object composition.

Latest version **0.0.2** (published 2019-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sullux/fp-light-call
pnpm add @sullux/fp-light-call
yarn add @sullux/fp-light-call
bun add @sullux/fp-light-call
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-03-02 |
| First published | 2019-02-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.* |
| Dependencies | 0 |
| Unpacked size | 1.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Charles Sullivan |
| Maintainers | sullux |
| Keywords | fp, functional, call |

## Links

- npm: https://www.npmjs.com/package/@sullux/fp-light-call
- Repository: https://github.com/sullux/fp-light
- Homepage: https://github.com/Sullux/fp-light/blob/master/lib/call/README.md
- Issues: https://github.com/sullux/fp-light/issues
- npm.io page: https://npm.io/package/@sullux/fp-light-call

## Recent versions

- 0.0.2 (latest) — 2019-03-02
- 0.0.1 — 2019-02-16

## README

[home](https://github.com/Sullux/fp-light/blob/master/README.md)

## fp-light-call

`npm i @sullux/fp-light-call`
[source](https://github.com/Sullux/fp-light/blob/master/lib/call/call.js)
[test](https://github.com/Sullux/fp-light/blob/master/lib/call/call.spec.js)

The purpose of the `call` helper is to allow the function to be passed as the most significant argument.

* [call](#call)

### call

`call(arg: any, fn: <T>(mixed) => T): T`

The `call` helper can be useful in functional composition. Consider the following example.

```javascript
const { call } = require('@sullux/fp-light-call')
const { get } = require('@sullux/fp-light-get')

const random0To31 = () =>
  Math.floor(Math.random() * 36)

const randomString = length =>
  Array(length)
    .fill()
    .map(random0To31)
    .map(get('toString'))
    .map(call(36))
    .join('')
```

Note that since the call utility accepts an argument first and a function second, the `.map(call(36))` sets up the call `toString(36)` for each input value. This isn't the most efficient example, but it is fully functional and serves as an example of passing a function as the most significant argument to the call utility.

---
_Source: https://npm.io/package/@sullux/fp-light-call · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
