2.1.4 • Published 26 days ago

@yoronsoft/js-utils v2.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
26 days ago

js-utils

npm install @yoronsoft/js-utils

使用说明

utils 工具

import {utilsIs, utilsTo, utilsDate, utilsReplace,utilsContrast} from '@yoronsoft/js-utils'

XmlHttpRequest 数据请求

//  header 类型
import {RequestData} from "@yoronsoft/js-utils";

RequestData.Header

//  contentType 类型
RequestData.ContentType

//  responseType 类型
RequestData.ResponseType

//  method 类型
RequestData.Method

//  请求数据
const http = new RequestData();
//  GET 方法
http.get(url, body)
//  POST 方法
http.post(url, body)
//  PUT 方法
http.put(url, body)
//  DELETE 方法
http.delete(url, body)

//  设置异步,默认为异步
http.setAsync(data);

//  设置 header
http.setHeader(name, value);

//  设置 HeaderBasic
http.setHeaderBasic(value);

//  设置 HeaderBasicBy
http.setHeaderBasicBy(account, password);

//  设置 HeaderBearer
http.setHeaderBearer(value);

//  设置 ResponseType
http.setResponseType(data);

//  设置 过期时间
http.setTimeout(name, value);

redux

import {redux} from "@yoronsoft/js-utils";

redux.all();
//  => any
redux.get<T>(name)
//  => T
redux.create<T>(name, params, isInit)
//  => T
redux.update<T>(name, params)
//  => T
redux.remove(name)
//  => void
redux.removeAndInit(name)
//  => void
2.1.4

26 days ago

2.1.2

27 days ago

2.1.1

29 days ago

2.1.3

27 days ago

2.1.0

29 days ago

2.0.0

1 month ago

1.2.0

2 months ago

1.1.7

3 months ago

1.1.6

3 months ago

1.1.5

3 months ago

1.1.4

3 months ago

1.1.3

3 months ago

1.1.1

4 months ago

1.1.0

4 months ago

1.1.2

4 months ago

1.0.2

5 months ago

1.0.1

6 months ago

1.0.0

10 months ago