1.0.1 • Published 4 years ago

@feizheng/bomb-decorator v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

bomb-decorator

Bomb decorator.

installation

npm install -S @feizehng/bomb-decorator

usage

import bomb from '@feizheng/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()
1.0.1

4 years ago

1.0.0

4 years ago