New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redux-saga-final-form

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-saga-final-form - npm Package Compare versions

Comparing version 1.2.0 to 2.0.0-0

3

dist/index.d.ts

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

import { Middleware } from 'redux';
export declare function useListener(startActionType: string, resolveActionType: string, rejectActionType: string, setPayload?: (payload: any) => Object): (payload: any) => Promise<unknown>;
export declare function finalFormSaga(): Generator<import("redux-saga/effects").ForkEffect<never>, void, unknown>;
export declare const handleListeners: Middleware;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.finalFormSaga = exports.useListener = void 0;
exports.handleListeners = exports.useListener = void 0;
const react_redux_1 = require("react-redux");
const effects_1 = require("redux-saga/effects");
const pendingCallbacks = new Map();

@@ -28,10 +27,10 @@ function useListener(startActionType, resolveActionType, rejectActionType, setPayload) {

exports.useListener = useListener;
function* handleEvent(action) {
const cbInfo = pendingCallbacks.get(action.type);
pendingCallbacks.delete(cbInfo.toClear);
cbInfo.callback(action.payload);
}
function* finalFormSaga() {
yield effects_1.takeEvery((action) => !!pendingCallbacks.get(action.type), handleEvent);
}
exports.finalFormSaga = finalFormSaga;
const handleListeners = ({ getState }) => {
return next => action => {
const cbInfo = pendingCallbacks.get(action.type);
pendingCallbacks.delete(cbInfo.toClear);
cbInfo.callback(action.payload);
return next(action);
};
};
exports.handleListeners = handleListeners;
{
"name": "redux-saga-final-form",
"version": "1.2.0",
"version": "2.0.0-0",
"description": "",

@@ -18,4 +18,3 @@ "main": "dist/index.js",

"peerDependencies": {
"react-redux": "^7.2.2",
"redux-saga": "^1.1.3"
"react-redux": "^7.2.2"
},

@@ -25,5 +24,4 @@ "devDependencies": {

"react-redux": "^7.2.2",
"redux-saga": "^1.1.3",
"typescript": "^4.1.3"
}
}

@@ -0,0 +0,0 @@ redux-saga-final-form

import { useDispatch } from 'react-redux';
import { takeEvery } from 'redux-saga/effects';
import { Middleware } from 'redux'

@@ -27,10 +27,11 @@ const pendingCallbacks = new Map<string, { callback: Function, toClear: string}>();

function *handleEvent(action: any) {
export const handleListeners: Middleware = ({ getState }) => {
return next => action => {
const cbInfo = pendingCallbacks.get(action.type)!;
pendingCallbacks.delete(cbInfo.toClear)
cbInfo.callback(action.payload);
}
export function* finalFormSaga() {
yield takeEvery((action: any) => !!pendingCallbacks.get(action.type), handleEvent);
return next(action)
}
}
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