1.0.0 • Published 3 years ago

@jswork/bomb-decorator v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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()