Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

redux-fluent

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-fluent - npm Package Compare versions

Comparing version
0.99.1
to
0.100.2
+22
dist/combine-reducers/combine-reducers.d.ts
import { RFR } from '../create-reducer/create-reducer';
declare type O<V> = V extends {
type: infer K;
} ? (K extends string ? K : never) : never;
declare type T<A> = {
[K in O<A>]: A;
};
interface CreateReducersMapObject {
<A extends RFR>(arg: A): T<A>;
<A extends RFR, B extends RFR>(arg: A, arg2: B): T<A> & T<B>;
<A extends RFR, B extends RFR, C extends RFR>(arg: A, arg2: B, arg3: C): T<A> & T<B> & T<C>;
<A extends RFR, B extends RFR, C extends RFR, D extends RFR>(arg: A, arg2: B, arg3: C, arg4: D): T<A> & T<B> & T<C> & T<D>;
<A extends RFR, B extends RFR, C extends RFR, D extends RFR, E extends RFR>(arg: A, arg2: B, arg3: C, arg4: D, arg5: E): T<A> & T<B> & T<C> & T<D> & T<E>;
<A extends RFR>(...args: RFR[]): {
[type: string]: RFR;
};
}
export declare const createReducersMapObject: CreateReducersMapObject;
export declare const combineReduxFluentReducers: (...reducers: RFR<string, any>[]) => import("redux").Reducer<import("redux").CombinedState<{
[x: string]: any;
}>, import("redux").AnyAction>;
export {};
import { ErrorFSA, FSA } from 'flux-standard-action';
export interface ReduxFluentAction<T extends string = string, P = void, M = void> extends FSA<T, P, M> {
type: T;
}
export interface ReduxFluentActionError<T extends string = string, E extends Error = Error, M = void> extends ErrorFSA<E, M> {
type: T;
}
export declare type Formatter<T, R> = (rawPayload: any, rawMeta: any, T: T) => R;
export declare type RFA<T extends string = string, P = any, M = any> = ReduxFluentAction<T, P, M>;
export declare type RFAE<T extends string = string, P extends Error = Error, M = any> = ReduxFluentActionError<T, P, M>;
export interface ActionCreator<T extends string, P, M> {
readonly type: T;
alias(payloadCreator?: Formatter<T, P>, metaCreator?: Formatter<M, P>): ActionCreator<T, P, M>;
<E extends Error = Error, RM = any>(rawPayload?: E, rawMeta?: RM): RFAE<T, E, M>;
<RP = any, RM = any>(rawPayload?: RP, rawMeta?: RM): RFA<T, P, M>;
}
export declare function createAction<T extends string = string, P = void, M = void>(type: T, payloadCreator?: Formatter<T, P>, metaCreator?: Formatter<T, M>): ActionCreator<T, P, M>;
import { Formatter } from './create-action';
export declare const createAliasCreator: <T extends string = string, P = void, M = void>(type: T) => (payloadCreator?: Formatter<T, P>, metaCreator?: Formatter<T, M>) => import("./create-action").ActionCreator<T, P, M>;
import { AnyAction } from 'redux';
interface ReduxFluentActionHandler<S = any, C = any> {
<A extends AnyAction>(state: S, action: A, config: C): S;
}
export interface ReduxFluentReducer<N extends string = string, S = any> {
readonly type: N;
(state: S | undefined, action: AnyAction): S;
}
export declare type RFR<N extends string = string, S = any> = ReduxFluentReducer<N, S>;
export declare type RFAH<S = any, C = any> = ReduxFluentActionHandler<S, C>;
declare type GetDefaultState<S = any, C = any> = (state: void, action: AnyAction, config: C) => S;
export declare function createReducer<N extends string, S = any, C = void>(name: N): {
actions(...handlers: RFAH<S, C>[]): {
default(getDefaultState?: GetDefaultState<S, C>): RFR<N, S>;
};
};
export {};
import { ReduxFluentReducer } from '../create-reducer/create-reducer';
export declare const withConfig: <CC = any>(config: CC) => <N extends string, S = any, C = any>(reducer: ReduxFluentReducer<N, S>) => import("../create-reducer/create-reducer").RFR<N, S>;
+7
-0

@@ -5,2 +5,9 @@ # Changelog

### [0.100.2](https://github.com/Code-Y/redux-fluent/compare/v0.99.1...v0.100.2) (2020-02-08)
### Features
* **actions:** support aliasing ([5d9cb6f](https://github.com/Code-Y/redux-fluent/commit/5d9cb6fe705622941a48095af9bf2fcb44453e6f))
### [0.99.1](https://github.com/Code-Y/redux-fluent/compare/v0.26.1...v0.99.1) (2019-12-24)

@@ -7,0 +14,0 @@

+1
-1

@@ -1,2 +0,2 @@

import { ActionCreator, RFA } from '../create-action/createAction';
import { ActionCreator, RFA } from '../create-action/create-action';
declare type AnyType<T extends string> = (T | ActionCreator<T, any, any> | {

@@ -3,0 +3,0 @@ [key: string]: any;

@@ -1,5 +0,5 @@

export { combineReduxFluentReducers as combineReducers, createReducersMapObject, } from './combine-reducers/combineReducers';
export { createAction } from './create-action/createAction';
export { createReducer } from './create-reducer/createReducer';
export { combineReduxFluentReducers as combineReducers, createReducersMapObject, } from './combine-reducers/combine-reducers';
export { createAction } from './create-action/create-action';
export { createReducer } from './create-reducer/create-reducer';
export { ofType } from './of-type/ofType';
export { withConfig } from './with-config/withConfig';
export { withConfig } from './with-config/with-config';
/**!
* @build-info development - Tue Dec 24 2019 09:04:42 GMT+0000 (Greenwich Mean Time)
* @build-info development - Sat Feb 08 2020 19:23:40 GMT+0000 (Greenwich Mean Time)
* @name redux-fluent
* @version 0.99.1
* @version 0.100.1
* @author Code-Y

@@ -106,6 +106,6 @@ * @description A Practical and Functional utility for redux

/***/ "./combine-reducers/combineReducers.ts":
/*!*********************************************!*\
!*** ./combine-reducers/combineReducers.ts ***!
\*********************************************/
/***/ "./combine-reducers/combine-reducers.ts":
/*!**********************************************!*\
!*** ./combine-reducers/combine-reducers.ts ***!
\**********************************************/
/*! exports provided: createReducersMapObject, combineReduxFluentReducers */

@@ -154,6 +154,6 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) {

/***/ "./create-action/createAction.ts":
/*!***************************************!*\
!*** ./create-action/createAction.ts ***!
\***************************************/
/***/ "./create-action/create-action.ts":
/*!****************************************!*\
!*** ./create-action/create-action.ts ***!
\****************************************/
/*! exports provided: createAction */

@@ -165,2 +165,4 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) {

/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAction", function() { return createAction; });
/* harmony import */ var _create_alias_creator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create-alias-creator */ "./create-action/create-alias-creator.ts");
function createAction(type, payloadCreator, metaCreator) {

@@ -183,2 +185,3 @@ var $payloadCreator = payloadCreator || (function (p) { return p; });

Object.defineProperties($action, {
alias: { value: Object(_create_alias_creator__WEBPACK_IMPORTED_MODULE_0__["createAliasCreator"])(type) },
name: { configurable: true, value: "action('" + type + "')" },

@@ -195,6 +198,24 @@ toString: { value: function () { return type; } },

/***/ "./create-reducer/createReducer.ts":
/*!*****************************************!*\
!*** ./create-reducer/createReducer.ts ***!
\*****************************************/
/***/ "./create-action/create-alias-creator.ts":
/*!***********************************************!*\
!*** ./create-action/create-alias-creator.ts ***!
\***********************************************/
/*! exports provided: createAliasCreator */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createAliasCreator", function() { return createAliasCreator; });
/* harmony import */ var _create_action__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create-action */ "./create-action/create-action.ts");
// eslint-disable-next-line no-unused-vars
var createAliasCreator = function (type) { return function (payloadCreator, metaCreator) { return Object(_create_action__WEBPACK_IMPORTED_MODULE_0__["createAction"])(type, payloadCreator, metaCreator); }; };
/***/ }),
/***/ "./create-reducer/create-reducer.ts":
/*!******************************************!*\
!*** ./create-reducer/create-reducer.ts ***!
\******************************************/
/*! exports provided: createReducer */

@@ -277,12 +298,12 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) {

__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _combine_reducers_combineReducers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./combine-reducers/combineReducers */ "./combine-reducers/combineReducers.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return _combine_reducers_combineReducers__WEBPACK_IMPORTED_MODULE_0__["combineReduxFluentReducers"]; });
/* harmony import */ var _combine_reducers_combine_reducers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./combine-reducers/combine-reducers */ "./combine-reducers/combine-reducers.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "combineReducers", function() { return _combine_reducers_combine_reducers__WEBPACK_IMPORTED_MODULE_0__["combineReduxFluentReducers"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createReducersMapObject", function() { return _combine_reducers_combineReducers__WEBPACK_IMPORTED_MODULE_0__["createReducersMapObject"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createReducersMapObject", function() { return _combine_reducers_combine_reducers__WEBPACK_IMPORTED_MODULE_0__["createReducersMapObject"]; });
/* harmony import */ var _create_action_createAction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create-action/createAction */ "./create-action/createAction.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createAction", function() { return _create_action_createAction__WEBPACK_IMPORTED_MODULE_1__["createAction"]; });
/* harmony import */ var _create_action_create_action__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./create-action/create-action */ "./create-action/create-action.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createAction", function() { return _create_action_create_action__WEBPACK_IMPORTED_MODULE_1__["createAction"]; });
/* harmony import */ var _create_reducer_createReducer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./create-reducer/createReducer */ "./create-reducer/createReducer.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createReducer", function() { return _create_reducer_createReducer__WEBPACK_IMPORTED_MODULE_2__["createReducer"]; });
/* harmony import */ var _create_reducer_create_reducer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./create-reducer/create-reducer */ "./create-reducer/create-reducer.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "createReducer", function() { return _create_reducer_create_reducer__WEBPACK_IMPORTED_MODULE_2__["createReducer"]; });

@@ -292,4 +313,4 @@ /* harmony import */ var _of_type_ofType__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./of-type/ofType */ "./of-type/ofType.ts");

/* harmony import */ var _with_config_withConfig__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./with-config/withConfig */ "./with-config/withConfig.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withConfig", function() { return _with_config_withConfig__WEBPACK_IMPORTED_MODULE_4__["withConfig"]; });
/* harmony import */ var _with_config_with_config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./with-config/with-config */ "./with-config/with-config.ts");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "withConfig", function() { return _with_config_with_config__WEBPACK_IMPORTED_MODULE_4__["withConfig"]; });

@@ -305,6 +326,6 @@

/***/ "./with-config/withConfig.ts":
/*!***********************************!*\
!*** ./with-config/withConfig.ts ***!
\***********************************/
/***/ "./with-config/with-config.ts":
/*!************************************!*\
!*** ./with-config/with-config.ts ***!
\************************************/
/*! exports provided: withConfig */

@@ -316,3 +337,3 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) {

/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "withConfig", function() { return withConfig; });
/* harmony import */ var _create_reducer_createReducer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../create-reducer/createReducer */ "./create-reducer/createReducer.ts");
/* harmony import */ var _create_reducer_create_reducer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../create-reducer/create-reducer */ "./create-reducer/create-reducer.ts");
var __assign = (undefined && undefined.__assign) || function () {

@@ -336,3 +357,3 @@ __assign = Object.assign || function(t) {

var $$context = reducer.$$context, type = reducer.type;
var $reducer = (_a = Object(_create_reducer_createReducer__WEBPACK_IMPORTED_MODULE_0__["createReducer"])(type)).actions.apply(_a, $$context.handlers).default($$context.getDefaultState);
var $reducer = (_a = Object(_create_reducer_create_reducer__WEBPACK_IMPORTED_MODULE_0__["createReducer"])(type)).actions.apply(_a, $$context.handlers).default($$context.getDefaultState);
// @ts-ignore TS2339

@@ -339,0 +360,0 @@ $reducer.$$context.config = __assign(__assign({}, ($$context.config || {})), config);

@@ -1,1 +0,1 @@

{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./combine-reducers/combineReducers.ts","webpack:///./create-action/createAction.ts","webpack:///./create-reducer/createReducer.ts","webpack:///./of-type/ofType.ts","webpack:///./redux-fluent.ts","webpack:///./with-config/withConfig.ts","webpack:///external \"redux\""],"names":[],"mappings":";;;;;;;;;;;;;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClFA,4BAA4B;AACY;AAkBjC,IAAM,uBAAuB,GAA4B;IAAC,kBAAkB;SAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;QAAlB,6BAAkB;;IAAK,eAAQ,CAAC,MAAM,CACrG,UAAC,GAAG,EAAE,OAAO;;QAAK,8BAAM,GAAG,gBAAG,OAAO,CAAC,IAAI,IAAG,OAAO,OAAG;IAArC,CAAqC,EACvD,EAAE,CACH;AAHuF,CAGvF,CAAC;AAEK,IAAM,0BAA0B,GAAG;IAAC,kBAAkB;SAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;QAAlB,6BAAkB;;IA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AAC;IAEtC,oBAAoB;IACpB,QAAQ,CAAC,SAAS,CAAC,MAAM,yBAEpB,CAAC,SAAS,CAAC,MAAM,IAAI,EAAE,CAAC,GACxB,MAAM,CACV,CAAC;IAEF,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE;QACtC,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,gBAAc,OAAO,CAAC,IAAI,MAAG;KACrC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,EArBmD,CAqBnD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AC1BF,kC","file":"redux-fluent.development.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/* eslint-disable max-len */\nimport { combineReducers } from 'redux';\n// eslint-disable-next-line no-unused-vars\nimport { RFR } from '../create-reducer/createReducer';\n\n\n// https://stackoverflow.com/questions/55086835/typescript-typings-array-of-t-to-map/55086869?noredirect=1#comment96919894_55086869\ntype O<V> = V extends { type: infer K } ? (K extends string ? K : never) : never;\ntype T<A> = { [K in O<A>]: A }\n\ninterface CreateReducersMapObject {\n <A extends RFR>(arg: A): T<A>\n <A extends RFR, B extends RFR>(arg: A, arg2: B): T<A> & T<B>;\n <A extends RFR, B extends RFR, C extends RFR>(arg: A, arg2: B, arg3: C): T<A> & T<B> & T<C>;\n <A extends RFR, B extends RFR, C extends RFR, D extends RFR>(arg: A, arg2: B, arg3: C, arg4: D): T<A> & T<B> & T<C> & T<D>;\n <A extends RFR, B extends RFR, C extends RFR, D extends RFR, E extends RFR>(arg: A, arg2: B, arg3: C, arg4: D, arg5: E): T<A> & T<B> & T<C> & T<D> & T<E>;\n <A extends RFR>(...args: RFR[]): { [type: string]: RFR };\n}\n\nexport const createReducersMapObject: CreateReducersMapObject = (...reducers: RFR[]) => reducers.reduce(\n (res, reducer) => ({ ...res, [reducer.type]: reducer }),\n {},\n);\n\nexport const combineReduxFluentReducers = (...reducers: RFR[]) => (\n combineReducers(createReducersMapObject(...reducers))\n);\n","// eslint-disable-next-line no-unused-vars\nimport { ErrorFSA, FSA } from 'flux-standard-action';\n\n\nexport interface ReduxFluentAction<\n T extends string = string,\n P = void,\n M = void,\n> extends FSA<T, P, M> {\n type: T;\n}\n\nexport interface ReduxFluentActionError<\n T extends string = string,\n E extends Error = Error,\n M = void,\n > extends ErrorFSA<E, M> {\n type: T;\n}\n\ntype Formatter<T, R> = (rawPayload: any, rawMeta: any, T: T) => R;\nexport type RFA<T extends string = string, P = any, M = any> = ReduxFluentAction<T, P, M>;\nexport type RFAE<T extends string = string, P extends Error = Error, M = any> = ReduxFluentActionError<T, P, M>;\n\nexport interface ActionCreator<T extends string, P, M> {\n readonly type: T;\n <E extends Error = Error, RM = any>(rawPayload?: E, rawMeta?: RM): RFAE<T, E, M>\n <RP = any, RM = any>(rawPayload?: RP, rawMeta?: RM): RFA<T, P, M>;\n}\n\nexport function createAction<T extends string = string, P = void, M = void>(\n type: T,\n payloadCreator?: Formatter<T, P>,\n metaCreator?: Formatter<T, M>,\n): ActionCreator<T, P, M> {\n const $payloadCreator = payloadCreator || ((p) => p);\n const $metaCreator = metaCreator || ((_, m) => m);\n\n function $action(rawPayload?: any, rawMeta?: any): RFA<T, P, M> {\n const payload: P = $payloadCreator(rawPayload, rawMeta, type);\n const meta: M = $metaCreator(rawPayload, rawMeta, type);\n\n const action: RFA<T, P, M> = { type };\n\n if (payload !== undefined) {\n action.error = payload instanceof Error;\n action.payload = payload;\n }\n\n if (meta !== undefined) {\n action.meta = meta;\n }\n\n return Object.freeze(action);\n }\n\n Object.defineProperties($action, {\n name: { configurable: true, value: `action('${type}')` },\n toString: { value: () => type },\n type: { enumerable: true, value: type },\n });\n\n // @ts-ignore TS2322 property `type` is defined in Object.defineProperties($action, ...)\n return $action;\n}\n","// eslint-disable-next-line no-unused-vars\nimport { AnyAction } from 'redux';\n\n\ninterface ReduxFluentActionHandler<S = any, C = any> {\n <A extends AnyAction>(state: S, action: A, config: C): S;\n}\n\nexport interface ReduxFluentReducer<N extends string = string, S = any> {\n readonly type: N;\n (state: S | undefined, action: AnyAction): S;\n}\n\nexport type RFR<N extends string = string, S = any> = ReduxFluentReducer<N, S>;\nexport type RFAH<S = any, C = any> = ReduxFluentActionHandler<S, C>;\ntype GetDefaultState<S = any, C = any> = (state: void, action: AnyAction, config: C) => S;\n\n\ninterface Context<S = any, C = any> {\n config: C,\n handlers: ReduxFluentActionHandler<S, C>[],\n getDefaultState: GetDefaultState<S, C>;\n}\n\nconst createContext = <S, C>(): Context<S, C> => ({\n config: undefined,\n getDefaultState: undefined,\n handlers: [],\n});\n\nexport function createReducer<N extends string, S = any, C = void>(name: N) {\n const context = createContext<S, C>();\n const orDefault = (state: S | undefined, action: AnyAction, config: C): S => (\n state === undefined ? context.getDefaultState(undefined, action, config) : state\n );\n\n function $reducer(state: S | undefined, action: AnyAction): S {\n return context.handlers.reduce(\n ($state, handler) => handler($state, action, context.config),\n orDefault(state, action, context.config),\n );\n }\n\n Object.defineProperties($reducer, {\n /* private */ $$context: { value: context },\n name: { configurable: true, value: `reducer('${name}')` },\n type: { enumerable: true, value: name },\n });\n\n return {\n actions(...handlers: RFAH<S, C>[]) {\n context.handlers = handlers;\n\n return {\n default(getDefaultState: GetDefaultState<S, C> = () => null): RFR<N, S> {\n context.getDefaultState = getDefaultState;\n\n // @ts-ignore TS2322 property `type` is defined in Object.defineProperties($reducer, ...)\n return $reducer;\n },\n };\n },\n };\n}\n","// eslint-disable-next-line no-unused-vars\nimport { AnyAction } from 'redux';\n// eslint-disable-next-line no-unused-vars\nimport { ActionCreator, RFA } from '../create-action/createAction';\n\n\ntype AnyType<T extends string> = (T | ActionCreator<T, any, any> | { [key: string]: any, type: T });\ntype R<S, A, C> = <AA extends A>(state: S, action: AA, config: C) => S;\ntype Map<A> = <S = any, C = any>(fn: R<S, A, C>) => R<S, A, C>;\n\ninterface OfType {\n <T extends string, P, M>(action: ActionCreator<T, P, M>): {\n map: Map<RFA<T, P, M>>,\n };\n <T extends string>(type: AnyType<T>): {\n map: Map<RFA<T>>,\n };\n (arg: AnyType<string>, ...rest: AnyType<string>[]): {\n map: Map<RFA>,\n };\n}\n\nexport const ofType: OfType = (...args: any[]) => {\n const types = args.map((a) => a.type || a.toString());\n\n return {\n map: <S = any, A extends AnyAction = AnyAction, C = void>(map: R<S, A, C>) => (\n (state: S, action: A, config: C): S => (\n types.includes(action.type) ? map(state, action, config) : state\n )\n ),\n };\n};\n","export {\n combineReduxFluentReducers as combineReducers,\n createReducersMapObject,\n} from './combine-reducers/combineReducers';\nexport { createAction } from './create-action/createAction';\nexport { createReducer } from './create-reducer/createReducer';\nexport { ofType } from './of-type/ofType';\nexport { withConfig } from './with-config/withConfig';\n","// eslint-disable-next-line no-unused-vars\nimport { createReducer, ReduxFluentReducer } from '../create-reducer/createReducer';\n\n\n// eslint-disable-next-line arrow-parens,max-len\nexport const withConfig = <CC = any>(config: CC) => <N extends string, S = any, C = any>(reducer: ReduxFluentReducer<N, S>) => {\n // @ts-ignore $$context is a private property\n const { $$context, type } = reducer;\n\n const $reducer = createReducer<N, S, C & CC>(type)\n .actions(...$$context.handlers)\n .default($$context.getDefaultState);\n\n // @ts-ignore TS2339\n $reducer.$$context.config = {\n\n ...($$context.config || {}),\n ...config,\n };\n\n Object.defineProperty($reducer, 'name', {\n configurable: true,\n value: `withConfig(${reducer.name})`,\n });\n\n return $reducer;\n};\n","module.exports = require(\"redux\");"],"sourceRoot":""}
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./combine-reducers/combine-reducers.ts","webpack:///./create-action/create-action.ts","webpack:///./create-action/create-alias-creator.ts","webpack:///./create-reducer/create-reducer.ts","webpack:///./of-type/ofType.ts","webpack:///./redux-fluent.ts","webpack:///./with-config/with-config.ts","webpack:///external \"redux\""],"names":[],"mappings":";;;;;;;;;;;;;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClFA,4BAA4B;AACY;AAkBjC,IAAM,uBAAuB,GAA4B;IAAC,kBAAkB;SAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;QAAlB,6BAAkB;;IAAK,eAAQ,CAAC,MAAM,CACrG,UAAC,GAAG,EAAE,OAAO;;QAAK,8BAAM,GAAG,gBAAG,OAAO,CAAC,IAAI,IAAG,OAAO,OAAG;IAArC,CAAqC,EACvD,EAAE,CACH;AAHuF,CAGvF,CAAC;AAEK,IAAM,0BAA0B,GAAG;IAAC,kBAAkB;SAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;QAAlB,6BAAkB;;IAAK,QAChE,6DAAe,CAAC,uBAAuB,eAAI,QAAQ,EAAE,CACtD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D;AACzC,IAAM,UAAU,GAAG,UAAW,MAAU,IAAK,iBAAqC,OAAiC;;IACxH,6CAA6C;IACrC,iCAAS,EAAE,mBAAI,CAAa;IAEpC,IAAM,QAAQ,GAAG,0FAAa,CAAe,IAAI,CAAC,EAC/C,OAAO,WAAI,SAAS,CAAC,QAAQ,EAC7B,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAEtC,oBAAoB;IACpB,QAAQ,CAAC,SAAS,CAAC,MAAM,yBAEpB,CAAC,SAAS,CAAC,MAAM,IAAI,EAAE,CAAC,GACxB,MAAM,CACV,CAAC;IAEF,MAAM,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE;QACtC,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,gBAAc,OAAO,CAAC,IAAI,MAAG;KACrC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,EArBmD,CAqBnD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;AC1BF,kC","file":"redux-fluent.development.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/* eslint-disable max-len */\nimport { combineReducers } from 'redux';\n// eslint-disable-next-line no-unused-vars\nimport { RFR } from '../create-reducer/create-reducer';\n\n\n// https://stackoverflow.com/questions/55086835/typescript-typings-array-of-t-to-map/55086869?noredirect=1#comment96919894_55086869\ntype O<V> = V extends { type: infer K } ? (K extends string ? K : never) : never;\ntype T<A> = { [K in O<A>]: A }\n\ninterface CreateReducersMapObject {\n <A extends RFR>(arg: A): T<A>\n <A extends RFR, B extends RFR>(arg: A, arg2: B): T<A> & T<B>;\n <A extends RFR, B extends RFR, C extends RFR>(arg: A, arg2: B, arg3: C): T<A> & T<B> & T<C>;\n <A extends RFR, B extends RFR, C extends RFR, D extends RFR>(arg: A, arg2: B, arg3: C, arg4: D): T<A> & T<B> & T<C> & T<D>;\n <A extends RFR, B extends RFR, C extends RFR, D extends RFR, E extends RFR>(arg: A, arg2: B, arg3: C, arg4: D, arg5: E): T<A> & T<B> & T<C> & T<D> & T<E>;\n <A extends RFR>(...args: RFR[]): { [type: string]: RFR };\n}\n\nexport const createReducersMapObject: CreateReducersMapObject = (...reducers: RFR[]) => reducers.reduce(\n (res, reducer) => ({ ...res, [reducer.type]: reducer }),\n {},\n);\n\nexport const combineReduxFluentReducers = (...reducers: RFR[]) => (\n combineReducers(createReducersMapObject(...reducers))\n);\n","// eslint-disable-next-line no-unused-vars\nimport { ErrorFSA, FSA } from 'flux-standard-action';\nimport { createAliasCreator } from './create-alias-creator';\n\n\nexport interface ReduxFluentAction<\n T extends string = string,\n P = void,\n M = void,\n> extends FSA<T, P, M> {\n type: T;\n}\n\nexport interface ReduxFluentActionError<\n T extends string = string,\n E extends Error = Error,\n M = void,\n > extends ErrorFSA<E, M> {\n type: T;\n}\n\nexport type Formatter<T, R> = (rawPayload: any, rawMeta: any, T: T) => R;\nexport type RFA<T extends string = string, P = any, M = any> = ReduxFluentAction<T, P, M>;\nexport type RFAE<T extends string = string, P extends Error = Error, M = any> = ReduxFluentActionError<T, P, M>;\n\nexport interface ActionCreator<T extends string, P, M> {\n readonly type: T;\n alias(payloadCreator?: Formatter<T, P>, metaCreator?: Formatter<M, P>): ActionCreator<T, P, M>;\n <E extends Error = Error, RM = any>(rawPayload?: E, rawMeta?: RM): RFAE<T, E, M>\n <RP = any, RM = any>(rawPayload?: RP, rawMeta?: RM): RFA<T, P, M>;\n}\n\nexport function createAction<T extends string = string, P = void, M = void>(\n type: T,\n payloadCreator?: Formatter<T, P>,\n metaCreator?: Formatter<T, M>,\n): ActionCreator<T, P, M> {\n const $payloadCreator = payloadCreator || ((p) => p);\n const $metaCreator = metaCreator || ((_, m) => m);\n\n function $action(rawPayload?: any, rawMeta?: any): RFA<T, P, M> {\n const payload: P = $payloadCreator(rawPayload, rawMeta, type);\n const meta: M = $metaCreator(rawPayload, rawMeta, type);\n\n const action: RFA<T, P, M> = { type };\n\n if (payload !== undefined) {\n action.error = payload instanceof Error;\n action.payload = payload;\n }\n\n if (meta !== undefined) {\n action.meta = meta;\n }\n\n return Object.freeze(action);\n }\n\n Object.defineProperties($action, {\n alias: { value: createAliasCreator<T, P, M>(type) },\n name: { configurable: true, value: `action('${type}')` },\n toString: { value: () => type },\n type: { enumerable: true, value: type },\n });\n\n // @ts-ignore TS2322 property `type` is defined in Object.defineProperties($action, ...)\n return $action;\n}\n","// eslint-disable-next-line no-unused-vars\nimport { createAction, Formatter } from './create-action';\n\nexport const createAliasCreator = <T extends string = string, P = void, M = void>(\n type: T,\n) => (payloadCreator?: Formatter<T, P>, metaCreator?: Formatter<T, M>) => createAction<T, P, M>(\n type,\n payloadCreator,\n metaCreator,\n);\n","// eslint-disable-next-line no-unused-vars\nimport { AnyAction } from 'redux';\n\n\ninterface ReduxFluentActionHandler<S = any, C = any> {\n <A extends AnyAction>(state: S, action: A, config: C): S;\n}\n\nexport interface ReduxFluentReducer<N extends string = string, S = any> {\n readonly type: N;\n (state: S | undefined, action: AnyAction): S;\n}\n\nexport type RFR<N extends string = string, S = any> = ReduxFluentReducer<N, S>;\nexport type RFAH<S = any, C = any> = ReduxFluentActionHandler<S, C>;\ntype GetDefaultState<S = any, C = any> = (state: void, action: AnyAction, config: C) => S;\n\n\ninterface Context<S = any, C = any> {\n config: C,\n handlers: ReduxFluentActionHandler<S, C>[],\n getDefaultState: GetDefaultState<S, C>;\n}\n\nconst createContext = <S, C>(): Context<S, C> => ({\n config: undefined,\n getDefaultState: undefined,\n handlers: [],\n});\n\nexport function createReducer<N extends string, S = any, C = void>(name: N) {\n const context = createContext<S, C>();\n const orDefault = (state: S | undefined, action: AnyAction, config: C): S => (\n state === undefined ? context.getDefaultState(undefined, action, config) : state\n );\n\n function $reducer(state: S | undefined, action: AnyAction): S {\n return context.handlers.reduce(\n ($state, handler) => handler($state, action, context.config),\n orDefault(state, action, context.config),\n );\n }\n\n Object.defineProperties($reducer, {\n /* private */ $$context: { value: context },\n name: { configurable: true, value: `reducer('${name}')` },\n type: { enumerable: true, value: name },\n });\n\n return {\n actions(...handlers: RFAH<S, C>[]) {\n context.handlers = handlers;\n\n return {\n default(getDefaultState: GetDefaultState<S, C> = () => null): RFR<N, S> {\n context.getDefaultState = getDefaultState;\n\n // @ts-ignore TS2322 property `type` is defined in Object.defineProperties($reducer, ...)\n return $reducer;\n },\n };\n },\n };\n}\n","// eslint-disable-next-line no-unused-vars\nimport { AnyAction } from 'redux';\n// eslint-disable-next-line no-unused-vars\nimport { ActionCreator, RFA } from '../create-action/create-action';\n\n\ntype AnyType<T extends string> = (T | ActionCreator<T, any, any> | { [key: string]: any, type: T });\ntype R<S, A, C> = <AA extends A>(state: S, action: AA, config: C) => S;\ntype Map<A> = <S = any, C = any>(fn: R<S, A, C>) => R<S, A, C>;\n\ninterface OfType {\n <T extends string, P, M>(action: ActionCreator<T, P, M>): {\n map: Map<RFA<T, P, M>>,\n };\n <T extends string>(type: AnyType<T>): {\n map: Map<RFA<T>>,\n };\n (arg: AnyType<string>, ...rest: AnyType<string>[]): {\n map: Map<RFA>,\n };\n}\n\nexport const ofType: OfType = (...args: any[]) => {\n const types = args.map((a) => a.type || a.toString());\n\n return {\n map: <S = any, A extends AnyAction = AnyAction, C = void>(map: R<S, A, C>) => (\n (state: S, action: A, config: C): S => (\n types.includes(action.type) ? map(state, action, config) : state\n )\n ),\n };\n};\n","export {\n combineReduxFluentReducers as combineReducers,\n createReducersMapObject,\n} from './combine-reducers/combine-reducers';\nexport { createAction } from './create-action/create-action';\nexport { createReducer } from './create-reducer/create-reducer';\nexport { ofType } from './of-type/ofType';\nexport { withConfig } from './with-config/with-config';\n","// eslint-disable-next-line no-unused-vars\nimport { createReducer, ReduxFluentReducer } from '../create-reducer/create-reducer';\n\n\n// eslint-disable-next-line arrow-parens,max-len\nexport const withConfig = <CC = any>(config: CC) => <N extends string, S = any, C = any>(reducer: ReduxFluentReducer<N, S>) => {\n // @ts-ignore $$context is a private property\n const { $$context, type } = reducer;\n\n const $reducer = createReducer<N, S, C & CC>(type)\n .actions(...$$context.handlers)\n .default($$context.getDefaultState);\n\n // @ts-ignore TS2339\n $reducer.$$context.config = {\n\n ...($$context.config || {}),\n ...config,\n };\n\n Object.defineProperty($reducer, 'name', {\n configurable: true,\n value: `withConfig(${reducer.name})`,\n });\n\n return $reducer;\n};\n","module.exports = require(\"redux\");"],"sourceRoot":""}
{
"name": "redux-fluent",
"license": "MIT",
"version": "0.99.1",
"version": "0.100.2",
"homepage": "https://github.com/Code-Y/redux-fluent#readme",

@@ -58,3 +58,3 @@ "description": "A Practical and Functional utility for redux",

"@types/chai": "^4.2.6",
"@types/jest": "^24.0.23",
"@types/jest": "^25.1.0",
"@types/node": "^13.1.0",

@@ -79,12 +79,12 @@ "@types/ramda": "^0.26.38",

"gitbook-plugin-edit-link": "^2.0.2",
"gitbook-plugin-github": "^2.0.0",
"gitbook-plugin-github-edit": "^1.1.0",
"gitbook-plugin-prism": "^2.4.0",
"husky": "^3.1.0",
"jest": "^24.9.0",
"ramda": "^0.26.1",
"husky": "^4.0.0",
"jest": "^25.1.0",
"ramda": "^0.27.0",
"redux": "^4.0.4",
"sinon": "^7.5.0",
"sinon": "^8.0.1",
"sinon-chai": "^3.3.0",
"standard-version": "^7.0.1",
"ts-jest": "^24.2.0",
"ts-jest": "^25.0.0",
"typescript": "^3.7.3",

@@ -91,0 +91,0 @@ "webpack": "^4.41.2",