Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apani-dukaan-redux-factory

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apani-dukaan-redux-factory - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

13

build/index.d.ts

@@ -13,15 +13,10 @@ import { Store, Reducer, Action, StoreEnhancer } from "redux";

export declare const getActionName: (prefix: string, name: string) => string;
export declare const getDataAction: <T>(prefix: string, name: string) => {
reset: ActionFunctionAny<import("redux-actions").Action<any>>;
init: ActionFunctionAny<import("redux-actions").Action<any>>;
failed: ActionFunction1<IDataError, import("redux-actions").Action<IDataError>>;
success: ActionFunction1<T, import("redux-actions").Action<T>>;
};
export interface IActions<T> {
export declare const getDataAction: <T, E = IDataError>(prefix: string, name: string) => IActions<T, E>;
export interface IActions<T, E = IDataError> {
reset: ActionFunctionAny<Action<unknown>>;
init: ActionFunctionAny<Action<unknown>>;
failed: ActionFunction1<IDataError, Action<IDataError>>;
failed: ActionFunction1<E, Action<E>>;
success: ActionFunction1<T, Action<T>>;
}
export declare const addDataActions: <T>(actions: IActions<T>, key: string) => (reducerFactory: ReducerFactory<any, any>) => void;
export declare const addDataActions: <T, E = IDataError>(actions: IActions<T, E>, key: string) => (reducerFactory: ReducerFactory<any, any>) => void;
export default store;
{
"name": "apani-dukaan-redux-factory",
"version": "0.0.3",
"version": "0.0.4",
"description": "lib for redux",

@@ -5,0 +5,0 @@ "main": "build/",

// Libraries
import {
createStore,
Store,
Reducer,
Action,
StoreEnhancer,
} from "redux";
import { createStore, Store, Reducer, Action, StoreEnhancer } from "redux";
import { logger } from "redux-logger";

@@ -42,19 +36,25 @@ import {

export const getDataAction = <T>(prefix: string, name: string) => {
return {
export const getDataAction = <T, E = IDataError>(
prefix: string,
name: string
) => {
return ({
reset: createAction(getActionName(prefix, `${name}_RESET`)),
init: createAction(getActionName(prefix, `${name}_INIT`)),
failed: createAction<IDataError>(getActionName(prefix, `${name}_FAILED`)),
success: createAction<T>(getActionName(prefix, `${name}_SUCCESS`)),
};
failed: createAction<E>(getActionName(prefix, `${name}_FAILED`)),
success: createAction(getActionName(prefix, `${name}_SUCCESS`)),
} as unknown) as IActions<T, E>;
};
export interface IActions<T> {
export interface IActions<T, E = IDataError> {
reset: ActionFunctionAny<Action<unknown>>;
init: ActionFunctionAny<Action<unknown>>;
failed: ActionFunction1<IDataError, Action<IDataError>>;
failed: ActionFunction1<E, Action<E>>;
success: ActionFunction1<T, Action<T>>;
}
export const addDataActions = <T>(actions: IActions<T>, key: string) => {
export const addDataActions = <T, E = IDataError>(
actions: IActions<T, E>,
key: string
) => {
return (reducerFactory: ReducerFactory<any, any>) => {

@@ -61,0 +61,0 @@ reducerFactory.add(actions.reset.toString(), (state) => {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc