Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ndhoule/invoker
Creates a function that invokes a named method.
https://github.com/ndhoule/invoker
Last synced: 13 days ago
JSON representation
Creates a function that invokes a named method.
- Host: GitHub
- URL: https://github.com/ndhoule/invoker
- Owner: ndhoule
- License: mit
- Created: 2015-02-27T05:31:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-29T23:00:14.000Z (over 8 years ago)
- Last Synced: 2024-09-23T01:18:10.653Z (about 2 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.md
Awesome Lists containing this project
README
# invoker [![CI][ci-badge]][ci-link]
Creates a function that invokes a given method.
## Installation
```sh
$ component install ndhoule/invoker
$ npm install @ndhoule/invoker
```## API
### `invoker(method : Function|string) => Function(receiver, ...args)`
Accepts a method name or a function, and returns a function that invokes that method on a receiver.
```javascript
var map = invoker('map');
map([1, 2, 3], function(num) {
return num + 1;
});
//=> [2, 3, 4]
```## License
Released under the [MIT license](LICENSE.md).
[ci-link]: https://travis-ci.org/ndhoule/invoker
[ci-badge]: https://travis-ci.org/ndhoule/invoker.svg?branch=master