open-index/open-npm huggingface dataset:
npm package: @requarks/vuex-pathify
Description: Ridiculously simple Vuex setup + wiring
Author: Dave Stewart
Latest version: 2.0.2


This is a fork of the amazing [vuex-pathify](https://davestewart.github.io/vuex-pathify) project, without the vue-class-component dependency. This fixes the warnings generated during import into a Vue 3 project.

## Usage

```
# Using npm:
npm install @requarks/vuex-pathify

# Using yarn:
yarn add @requarks/vuex-pathify
```

Then follow the instructions from the [vuex-pathify](https://davestewart.github.io/vuex-pathify) docs but replacing any import of `vuex-pathify` with `@requarks/vuex-pathify`.
npm package: @request-kit/controller-redux
Description: redux implementation of request controller: initialize requests and manage their state
Author: Gleb Lobastov
Latest version: 0.4.0-alpha.0

### About

Controller to invoke remote requests calls through redux middleware. Also reducer provided to keep request state in redux store.

### Example use case

```ecmascript 6
import createRequestEngine from '@request-kit/engine-rest';
import {createRequestMiddleware,requestReducer} from '@request-kit/controller-redux';

const requestMiddleware = createRequestMiddleware({
  engine: createRequestEngine({}),
});
const store = createStore(
  combineReducers({
    requests: requestReducer,
  }),
  applyMiddleware(requestMiddleware)
);
store.dispatch(createRequestAction({ endpoint: '/echo'}));
```
npm package: @request-kit/distribute-reducer
Description: alter existent reducer to make hierarchical groups inside redux state
Author: Gleb Lobastov
Latest version: 0.3.0

### About

**distributeReducerByDomain** is wrapper to apply over your redux reducer.

When applied it turns passed state into hierarchy of nested states. Every state is accessible by path, called here "domain". Wrapped reducer will be applied only to state of domain specified in action.

Domain used to select either particular state or array of all states in hierarchy

Domain is represented as string with "." delimiters.
Each part is domain name in appropriate level of domains hierarchy.

"Libraries.Redux" domain is nested in "Libraries" domain. If select all states of "Libraries" domain "Libraries.Redux" will be in list.

### Example use case

_or original purpose of this module_

Manage related server requests. Utility give handy access to states of all requests on current page by domain "%page%". This is convenient to show errors and loading indicators. Moreover requests could be divided as "fetch" and "submit", or "%component%" or "%actionType%", etc.

### API

```ecmascript 6
const {
  /* Provided API */
  reducer,
  selectDomainState,
  selectDomainStates,
} = distributeReducerByDomain({
  /* Configuration */
  domainSeparator,
  domainProperty,
  reducer, // only required
});
```

#### Provided API

1.  **reducer(state, action) => state** – wrapped reducer
1.  **selectDomainState(state, domain) => domainState** – select only state of specified domain. No nested states included
1.  **selectDomainStates(state, domain) => [...domainStates]** – select array, consist of specified domain state and all it nested (recursively) domains state

#### Configuration

1.  **domainSeparator** – sign used to separate nested domain names in path. Default to '.'
1.  **domainProperty** – specify domain path property in redux action. Could be string (dot-separated path) or function, that receives action. Default to 'meta.domain'
1.  **reducer** – wrapped reducer. Required!
npm package: @request-kit/engine-rest
Description: wrapper over fetch or other http-client to make rest requests, compatible with other request-kit parts
Author: Gleb Lobastov
Latest version: 0.3.0

### About

Realization of request-kit engine interface, to process rest request. Extandable with plugins

### Example use case

```ecmascript 6
const engine = createRequestEngine({
    plugins: [pluginA, pluginB],
});
engine.request({ endpoint: '/api/v1/url' });
```

### API

engine.preset(configurationObject) – apply additional configuration, which overrides existent one if collide (acts like assign). Exception is for headers, only same headers will overwritten, new header would just added to existent headers object.

Note, in fact new engine will create on each preset call. So, it's possible to even use previous engine and preset one:

```ecmascript 6
const legacyApiEngine = engine.preset({ apiVersion: 'v1' })
const apiEngine = engine.preset({ apiVersion: 'v2' })
```

engine.request(configurationObject) – execute request. Also may override configuration with same principles as preset, but those overriding not saved, and only applied to currently executing request

#### Configuration object options

fetchHandler – method to process request, by default window.fetch is used, but instead any third-party lib could be used. For example superagent or axios. It's could be convenient to use same lib that already used in other parts of project.

fetchAdapter - function to adapt request config generated by engine to signature of tool specified in fetchHandler. By default config is adapted to window.fetch. config.endpoint used as fetch first param, and rest config object just passed as second.

Request config is always plain object. Almost all of it properties is passed from project or generated in plugins, so it's up to project, how to configure adapter.

**Note:** All plugins from request-kit is made to have window.fetch compatible format

plugins - array of functions, where each could modify request config. Should be written like shown in example:

```ecmascript 6
export default next => ({ endpoint, ...restOptions }) => next({
  endpoint: typeof endpoint === 'string' ? endpoint : endpoint(restOptions),
   ...restOptions,
});
```
npm package: @request-kit/intg-react-redux
Description: react high order component, bound with redux, to process request and provide data to component
Author: Gleb Lobastov
Latest version: 0.4.0-alpha.0

### About

Toolkit to automate data fetching in react && redux based application. Library export configuration function which returns reducer, middleware and high order component.

Request config is just passed to HOC and it's provide request state and results to wrapped component as props.

### Example use case

requestKit.js

```ecmascript 6
import configureRequestKit from '@request-kit/react-redux';
import createEngine from '@request-kit/rest-engine';

const {
  middleware,
  provide,
  reducer,
} = configureRequestKit({
  engine: createRestEngine({}),
});

export { middleware, provide, reducer, selectors}
```

store.js

```ecmascript 6
import { createStore, applyMiddleware } from 'redux';
import { middleware, reducer } from 'requestKit';

export const createStore(reducer, applyMiddleware(middleware));
```

MyComponent.js

```jsx harmony
import React from 'react';
import { provide } from 'requestKit';

class MyComponent extends React.Component {
  render() {
    const { provision, fallback, isReady, isPending, error } = this.props;
    return (
      <div>
        <div>Request result is {provision}</div>
        <div>Request error is {error}</div>
        <div>Last successful result is {fallback}</div>
        <div>Is request pending {isPending}</div>
        <div>Is request finished {isReady}</div>
      </div>
    );
  }
}

const mapStateToRequirements = state => ({
  domain: 'any',
  endpoint: `api/model/${state.currentId}`,
});

export default provide(mapStateToRequirements)(MyComponent);
```

#### Configuration

engine – realization of request-kit engine interface, currently only @request-kit/engine-rest is implemented, see package [docs](../../engine/rest/README.md#About) for details

provisionStateSelector – path to provision state in redux state. It could be dot separated string: 'paths.to.state' or function, which get root state and return provison state
npm package: @request-kit/intg-redux-model-normalized
Description: enhancer for redux controller to integrate with model-normalized package
Author: Gleb Lobastov
Latest version: 0.4.0-alpha.0

### About

Toolkit to automate data fetching in react && redux based application. Library export configuration function which returns reducer, middleware and high order component.

Request config is just passed to HOC and it's provide request state and results to wrapped component as props.

### Example use case

requestKit.js

```ecmascript 6
import configureRequestKit from '@request-kit/react-redux';
import createEngine from '@request-kit/rest-engine';

const {
  middleware,
  provide,
  reducer,
} = configureRequestKit({
  engine: createRestEngine({}),
});

export { middleware, provide, reducer, selectors}
```

store.js

```ecmascript 6
import { createStore, applyMiddleware } from 'redux';
import { middleware, reducer } from 'requestKit';

export const createStore(reducer, applyMiddleware(middleware));
```

MyComponent.js

```jsx harmony
import React from 'react';
import { provide } from 'requestKit';

class MyComponent extends React.Component {
  render() {
    const { provision, fallback, isReady, isPending, error } = this.props;
    return (
      <div>
        <div>Request result is {provision}</div>
        <div>Request error is {error}</div>
        <div>Last successful result is {fallback}</div>
        <div>Is request pending {isPending}</div>
        <div>Is request finished {isReady}</div>
      </div>
    );
  }
}

const mapStateToRequirements = state => ({
  domain: 'any',
  endpoint: `api/model/${state.currentId}`,
});

export default provide(mapStateToRequirements)(MyComponent);
```

#### Configuration

engine – realization of request-kit engine interface, currently only @request-kit/engine-rest is implemented, see package [docs](../../engine/rest/README.md#About) for details

provisionStateSelector – path to provision state in redux state. It could be dot separated string: 'paths.to.state' or function, which get root state and return provison state
npm package: @request-kit/preset-react-redux-entities
Description: react high order component, bound with redux, to process request and provide data to component
Author: Gleb Lobastov
Latest version: 0.4.0-alpha.0

### About

Toolkit to automate data fetching in react && redux based application. Library export configuration function which returns reducer, middleware and high order component.

Request config is just passed to HOC and it's provide request state and results to wrapped component as props.

### Example use case

requestKit.js

```ecmascript 6
import configureRequestKit from '@request-kit/react-redux';
import createEngine from '@request-kit/rest-engine';

const {
  middleware,
  provide,
  reducer,
} = configureRequestKit({
  engine: createRestEngine({}),
});

export { middleware, provide, reducer, selectors}
```

store.js

```ecmascript 6
import { createStore, applyMiddleware } from 'redux';
import { middleware, reducer } from 'requestKit';

export const createStore(reducer, applyMiddleware(middleware));
```

MyComponent.js

```jsx harmony
import React from 'react';
import { provide } from 'requestKit';

class MyComponent extends React.Component {
  render() {
    const { provision, fallback, isReady, isPending, error } = this.props;
    return (
      <div>
        <div>Request result is {provision}</div>
        <div>Request error is {error}</div>
        <div>Last successful result is {fallback}</div>
        <div>Is request pending {isPending}</div>
        <div>Is request finished {isReady}</div>
      </div>
    );
  }
}

const mapStateToRequirements = state => ({
  domain: 'any',
  endpoint: `api/model/${state.currentId}`,
});

export default provide(mapStateToRequirements)(MyComponent);
```

#### Configuration

engine – realization of request-kit engine interface, currently only @request-kit/engine-rest is implemented, see package [docs](../../engine/rest/README.md#About) for details

provisionStateSelector – path to provision state in redux state. It could be dot separated string: 'paths.to.state' or function, which get root state and return provison state
npm package: @request-kit/react-redux
Description: react high order component, bound with redux, to process request and provide data to component
Author: Gleb Lobastov
Latest version: 0.3.0

### About

Toolkit to automate data fetching in react && redux based application. Library export configuration function which returns reducer, middleware and high order component.

Request config is just passed to HOC and it's provide request state and results to wrapped component as props.

### Example use case

requestKit.js

```ecmascript 6
import configureRequestKit from '@request-kit/react-redux';
import createEngine from '@request-kit/rest-engine';

const {
  middleware,
  provide,
  reducer,
} = configureRequestKit({
  engine: createRestEngine({}),
});

export { middleware, provide, reducer, selectors}
```

store.js

```ecmascript 6
import { createStore, applyMiddleware } from 'redux';
import { middleware, reducer } from 'requestKit';

export const createStore(reducer, applyMiddleware(middleware));
```

MyComponent.js

```jsx harmony
import React from 'react';
import { provide } from 'requestKit';

class MyComponent extends React.Component {
  render() {
    const { provision, fallback, isReady, isPending, error } = this.props;
    return (
      <div>
        <div>Request result is {provision}</div>
        <div>Request error is {error}</div>
        <div>Last successful result is {fallback}</div>
        <div>Is request pending {isPending}</div>
        <div>Is request finished {isReady}</div>
      </div>
    );
  }
}

const mapStateToRequirements = state => ({
  domain: 'any',
  endpoint: `api/model/${state.currentId}`,
});

export default provide(mapStateToRequirements)(MyComponent);
```

#### Configuration

engine – realization of request-kit engine interface, currently only @request-kit/engine-rest is implemented, see package [docs](../../engine/rest/README.md#About) for details

provisionStateSelector – path to provision state in redux state. It could be dot separated string: 'paths.to.state' or function, which get root state and return provison state
npm package: @request-sdk/base
Description: request sdk
Author: AlfieriChou
Latest version: 0.0.11

# `base`

> request sdk utils and middleware

## Usage

```javascript
const { utils, requestLog } = require('@request-sdk/base')

const logBody = false
requestLog(logBody)

utils.fillReqId()

const pkg = require('./package.json')
utils.fillPkgInfo(pkg)

const logger = console
utils.createLogger(logger)
```

### middleware

* requestLog

### utils

* fillReqId

* fillPkgInfo

* createLogger
npm package: @request-sdk/fund
Description: request sdk fund.
Author: AlfieriChou
Latest version: 0.0.11

# `fund`

> fund request sdk.

## Usage

```javascript
const Api = require('@request-sdk/fund')

const logger = console

const fund = new Api({
  logger
})

const ret = await fund.get('http://t.com/api/xxx', {
  a: 'b'
})

const ret2 = await fund.post('http://t.com/api/xxx', {
  a: 'b'
})
```

### methods

* get

```javascript
fund.get('http://t.com/api/xxx', {
  a: 'b'
})
```

* post

```javascript
fund.post('http://t.com/api/xxx', {
  a: 'b'
})
```

* loadDataFromPrevNDays

```javascript
fund.loadDataFromPrevNDays('004744', 11)
```

* loadDataFromPrevNDaysV2

```javascript
fund.loadDataFromPrevNDaysV2({
  code: '004744',
  days: 11,
  dateInfo: {
    date: 1669132800000
  }
})
```

* loadMaData

```javascript
fund.loadMaData({
  code: '004744',
  limit: 11,
  deflate: x => x.unitNetWorth,
  dateInfo: {
    date: 1669132800000
  }
})
```

* loadCurrentMaData

```javascript
fund.loadCurrentMaData({
  code: '004744',
  limit: 11,
  deflate: x => x.unitNetWorth
})
```

* getCurrentData

```javascript
fund.getCurrentData('004744')
```
npm package: @request-sdk/stock
Description: stock request sdk.
Author: AlfieriChou
Latest version: 0.0.11

# `stock`

> stock request sdk.

## Usage

```javascript
const Api = require('@request-sdk/stock')

const logger = console

const api = new Api({
  logger
})

const ret = await api.get('http://t.com/api/xxx', {
  a: 'b'
}, {
  responseType: 'json'
})

const ret2 = await api.post('http://t.com/api/xxx', {
  a: 'b'
}, {
  responseType: 'json'
})
```

### methods

* get

```javascript
api.get('http://t.com/api/xxx', {
  a: 'b'
}, {
  responseType: 'json'
})
```

* post

```javascript
api.post('http://t.com/api/xxx', {
  a: 'b'
}, {
  responseType: 'json'
})
```

* getCurrentInfo

```javascript
api.getCurrentInfo('600900')
```

* loadHistoryData

```javascript
api.loadHistoryData({
  code: '600900', dataLen: 11, scale: 240
})
```

* loadDataFromPrevNDays

```javascript
api.loadDataFromPrevNDays('600900', 11)
```

* loadMaData

```javascript
api.loadMaData({
  code: '600900', limit: 11, deflate: x => x.close
})
```

* loadMdData

```javascript
api.loadMdData({
  code: '600900', limit: 11, deflate: x => x.close
})
```

* loadCciData

```javascript
api.loadCciData({
  code: '600900', limit: 14, coefficient: 0.015
})
```

* loadRsiData

```javascript
api.loadRsiData({
  code: '600900', limit: 12, deflate: x => x.close
})
```
npm package: @request-sentinel/request-sentinel-js
Description: Request Sentinel javascript library
Author: Umar Nizamani
Latest version: 0.1.2

# Request Sentinel - JS SDK

Javascript SDK for [RequestSentinel](https://requestsentinel.com)

### Install via npm

`npm install request-sentinel`

### Install via CDN

 `<script src="https://unpkg.com/@request-sentinel/request-sentinel-js@0.1.0/dist/index.js"></script>`

### Setup

`RequestSentinel.init('API_KEY', 'YOUR_APP_VERSION', 'YOUR_APP_ENVIRONMENT')`
npm package: @request-template/axios
Description: axios请求模板封装
Author: DYH
Latest version: 2.2.4

# 请求模版封装：axios 版

## 安装方法

```
npm intall axios request-template @request-template/axios
```

## 使用方法

见[相关文章](https://juejin.cn/post/7093398640898605069/)
npm package: @request-template/react-hooks
Description: 请求模板封装-react-hooks
Author: DYH
Latest version: 2.2.4

# 请求模版封装：vue3 hooks 工具

## 安装方法

```
npm intall @request-template/react-hooks
```

## 使用方法

react-hooks跟vue3-hooks不一样，由于始终都要setxxx，所以只保留了基础的手动请求功能，为数据驱动防抖和节流保留的功能也不再需要了
npm package: @request-template/vue3-hooks
Description: axios请求模板封装-vue3-hooks
Author: DYH
Latest version: 2.2.4

# 请求模版封装：vue3 hooks 工具

## 安装方法

```
npm intall @request-template/vue3-hooks
```

## 使用方法

请求分为手动调用和数据驱动两种调用方式

具体使用方法见[测试文件](./__tests__/useRequest.test.ts)