bang-ng-utils
TypeScript icon, indicating that this package has built-in type declarations

0.0.15 • Public • Published

bang-ng-utils

use

import {HttpService,DispatchAction,getCookie,setCookie} from 'bang-ng-utils';
new HttpService(this.httpClient).get(url,entity//实体映射类,prams//传递值,headers//自定义头部信息,默认无须设置)
new HttpService(this.httpClient).post(url,entity//实体映射类,prams//传递值,headers//自定义头部信息,默认无须设置)

new DispatchAction<ContainerStore>(this).init(()=>{
            this.test=observablePromise<Hero[]>() //设置初始Pending 用于拆分数据状态,如Pending,resolved等,常见应用场景loading
        }).set(heroService.getHeroes(),(data)=>{heroService.getHeroes()//返回一个Observable  rxjs ,第二个参数成功回调函数  在此我们约定所有服务端数据结构都是从              observablePromise函数出来
            this.test=observablePromise(data)
        });

Readme

Keywords

Package Sidebar

Install

npm i bang-ng-utils

Weekly Downloads

3

Version

0.0.15

License

MIT

Unpacked Size

23 kB

Total Files

15

Last publish

Collaborators

  • duanguang