# promise-fnapply

> A Function.apply that can deal with promise arguments

Latest version **1.1.0** (published 2016-03-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install promise-fnapply
pnpm add promise-fnapply
yarn add promise-fnapply
bun add promise-fnapply
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-03-03 |
| First published | 2015-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Joakim Carlstein |
| Maintainers | joakimbeng |
| Keywords | promise, apply, function, functional |

## Links

- npm: https://www.npmjs.com/package/promise-fnapply
- Repository: https://github.com/joakimbeng/promise-fnapply
- Homepage: https://github.com/joakimbeng/promise-fnapply#readme
- Issues: https://github.com/joakimbeng/promise-fnapply/issues
- npm.io page: https://npm.io/package/promise-fnapply

## Dependencies (1)

- [promise-all](https://npm.io/package/promise-all.md) ^1.0.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2016-03-03
- 1.0.0 — 2015-09-14

## README

# promise-fnapply

[![Build status][travis-image]][travis-url] [![NPM version][npm-image]][npm-url] [![XO code style][codestyle-image]][codestyle-url]

> A Function.apply that can deal with promise arguments

## Installation

Install `promise-fnapply` using [npm](https://www.npmjs.com/):

```bash
npm install --save promise-fnapply
```

## Usage

### Module usage

```javascript
const apply = require('promise-fnapply');

function greet(val) {
  return `hello ${val}`;
}

apply(greet, [Promise.resolve('world')])
  .then(val => {
    // val === 'hello world'
  });
```

## API

### `apply(fn, promises, thisArg)`

| Name | Type | Description |
|------|------|-------------|
| `fn` | `Function|Promise<Function>`| The function, or a promise resolving to a function, to apply with the resolved promises as argument array |
| `promises` | `Array<Promise>`| The arguments array to pass to `fn` when they all are resolved |
| `thisArg` | `Any` | The value to be passed as `this` when calling `fn` |

Returns: `Promise`, which resolves to the result of applying `fn` with the resolved values of `promises`.

## Related

* [`promise-or`](https://github.com/joakimbeng/promise-or)
* [`promise-and`](https://github.com/joakimbeng/promise-and)
* [`promise-if`](https://github.com/joakimbeng/promise-if)
* [`promise-not`](https://github.com/joakimbeng/promise-not)
* [`promise-all`](https://github.com/joakimbeng/promise-all)
* [`promise-get`](https://github.com/joakimbeng/promise-get)
* [`promise-fncall`](https://github.com/joakimbeng/promise-fncall)

## License

MIT © [Joakim Carlstein](http://joakim.beng.se)

[npm-url]: https://npmjs.org/package/promise-fnapply
[npm-image]: https://badge.fury.io/js/promise-fnapply.svg
[travis-url]: https://travis-ci.org/joakimbeng/promise-fnapply
[travis-image]: https://travis-ci.org/joakimbeng/promise-fnapply.svg?branch=master
[codestyle-url]: https://github.com/sindresorhus/xo
[codestyle-image]: https://img.shields.io/badge/code%20style-XO-5ed9c7.svg?style=flat

---
_Source: https://npm.io/package/promise-fnapply · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
