UNPKG

1.7 kBMarkdownView Raw
1## @ject/chore
2Make class method.
3
4[![npm version][badge-npm-version]][url-npm]
5[![npm download monthly][badge-npm-download-monthly]][url-npm]
6[![npm download total][badge-npm-download-total]][url-npm]
7[![npm dependents][badge-npm-dependents]][url-github]
8[![npm license][badge-npm-license]][url-npm]
9[![pp install size][badge-pp-install-size]][url-pp]
10[![github commit last][badge-github-last-commit]][url-github]
11[![github commit total][badge-github-commit-count]][url-github]
12
13[//]: <> (Shields)
14[badge-npm-version]: https://flat.badgen.net/npm/v/@ject/chore
15[badge-npm-download-monthly]: https://flat.badgen.net/npm/dm/@ject/chore
16[badge-npm-download-total]:https://flat.badgen.net/npm/dt/@ject/chore
17[badge-npm-dependents]: https://flat.badgen.net/npm/dependents/@ject/chore
18[badge-npm-license]: https://flat.badgen.net/npm/license/@ject/chore
19[badge-pp-install-size]: https://flat.badgen.net/packagephobia/install/@ject/chore
20[badge-github-last-commit]: https://flat.badgen.net/github/last-commit/hoyeungw/vect
21[badge-github-commit-count]: https://flat.badgen.net/github/commits/hoyeungw/vect
22
23[//]: <> (Link)
24[url-npm]: https://npmjs.org/package/@ject/chore
25[url-pp]: https://packagephobia.now.sh/result?p=@ject/chore
26[url-github]: https://github.com/hoyeungw/vect
27
28## Features
29
30- Make class method
31
32## Install
33```console
34$ npm install @ject/chore
35```
36
37## Usage
38```js
39import { Callable } from '@ject/chore'
40// inherit the class Callable
41class CallableClass extends Callable {
42 constructor (a, b) {
43 super(row => this.a + this.b + row)
44 this.a = a
45 this.b = b
46 }
47}
48
49const methodClass = new CallableClass(5, 4)
50console.log(methodClass(3)) // 12
51
52```
53
54## Meta
55[LICENSE (MIT)](LICENSE)