@jswork/bomb-decorator

1.0.0 • Public • Published

bomb-decorator

Bomb decorator.

installation

npm install @jswork/bomb-decorator

usage

import bomb from '@jswork/bomb-decorator';

class MyHttp(){
  request(){
    // your codes...
  }

  @bomb
  'post,get,put,delete'(inName){
    return (inUrl,inData) => {
      this.request(inName, inUrl, inData);
    };
  }
}

// const http = new MyHttp();
// Now, http has these methods:

// http.post()
// http.get()
// http.put()
// http.delete()
// http.request()

Dependents (0)

Package Sidebar

Install

npm i @jswork/bomb-decorator

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.4 kB

Total Files

4

Last publish

Collaborators

  • afeiship