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

@redux-saga/core

Package Overview
Dependencies
Maintainers
3
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redux-saga/core - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

dist/io-0d26a232.js

2

dist/redux-saga-core.dev.cjs.js

@@ -11,3 +11,3 @@ 'use strict';

var is = require('@redux-saga/is');
var io = require('./io-1d6eccda.js');
var io = require('./io-3da4d602.js');
var redux = require('redux');

@@ -14,0 +14,0 @@ var deferred = _interopDefault(require('@redux-saga/deferred'));

@@ -6,4 +6,4 @@ import { CHANNEL_END_TYPE, MULTICAST, MATCH, SAGA_ACTION, CANCEL, SELF_CANCELLATION, TERMINATE, TASK, TASK_CANCEL, IO } from '@redux-saga/symbols';

import { string as string$1, array as array$1, stringableFunc, func, symbol as symbol$1, buffer, notUndef, promise, iterator, undef, object, channel as channel$1 } from '@redux-saga/is';
import { k as kTrue, e as expanding, c as check, o as once, r as remove, n as none, i as internalErr, T as TAKE, P as PUT, A as ALL, R as RACE, C as CALL, a as CPS, F as FORK, J as JOIN, b as CANCEL$1, S as SELECT, d as ACTION_CHANNEL, f as CANCELLED$1, g as FLUSH, G as GET_CONTEXT, h as SET_CONTEXT, j as getMetaInfo, l as createAllStyleChildCallbacks, m as createEmptyArray, p as assignWithSymbols, q as makeIterator, s as shouldComplete, t as noop, u as flatMap, v as getLocation, w as createSetContextWarning, x as asyncIteratorSymbol, y as shouldCancel, z as shouldTerminate, B as logError, D as wrapSagaDispatch, E as identity } from './io-6de156f3.js';
export { H as buffers, I as detach } from './io-6de156f3.js';
import { k as kTrue, e as expanding, c as check, o as once, r as remove, n as none, i as internalErr, T as TAKE, P as PUT, A as ALL, R as RACE, C as CALL, a as CPS, F as FORK, J as JOIN, b as CANCEL$1, S as SELECT, d as ACTION_CHANNEL, f as CANCELLED$1, g as FLUSH, G as GET_CONTEXT, h as SET_CONTEXT, j as getMetaInfo, l as createAllStyleChildCallbacks, m as createEmptyArray, p as assignWithSymbols, q as makeIterator, s as shouldComplete, t as noop, u as flatMap, v as getLocation, w as createSetContextWarning, x as asyncIteratorSymbol, y as shouldCancel, z as shouldTerminate, B as logError, D as wrapSagaDispatch, E as identity } from './io-40341e1a.js';
export { H as buffers, I as detach } from './io-40341e1a.js';
import { compose } from 'redux';

@@ -10,0 +10,0 @@ import deferred from '@redux-saga/deferred';

@@ -11,3 +11,3 @@ 'use strict';

var is = require('@redux-saga/is');
var io = require('./io-d7550be2.js');
var io = require('./io-0d26a232.js');
var redux = require('redux');

@@ -14,0 +14,0 @@ var deferred = _interopDefault(require('@redux-saga/deferred'));

@@ -8,3 +8,3 @@ 'use strict';

var is = require('@redux-saga/is');
var io = require('./io-1d6eccda.js');
var io = require('./io-3da4d602.js');
require('@redux-saga/delay-p');

@@ -11,0 +11,0 @@

import '@redux-saga/symbols';
import '@babel/runtime/helpers/esm/extends';
import { channel, stringableFunc, func, notUndef } from '@redux-saga/is';
import { q as makeIterator, K as take, L as fork, M as cancel, N as call, O as actionChannel, Q as sliding, U as delay, V as race, c as check } from './io-6de156f3.js';
export { O as actionChannel, _ as all, $ as apply, N as call, M as cancel, a4 as cancelled, a0 as cps, U as delay, W as effectTypes, a5 as flush, L as fork, a6 as getContext, a2 as join, Y as put, Z as putResolve, V as race, a3 as select, a7 as setContext, a1 as spawn, K as take, X as takeMaybe } from './io-6de156f3.js';
import { q as makeIterator, K as take, L as fork, M as cancel, N as call, O as actionChannel, Q as sliding, U as delay, V as race, c as check } from './io-40341e1a.js';
export { O as actionChannel, _ as all, $ as apply, N as call, M as cancel, a4 as cancelled, a0 as cps, U as delay, W as effectTypes, a5 as flush, L as fork, a6 as getContext, a2 as join, Y as put, Z as putResolve, V as race, a3 as select, a7 as setContext, a1 as spawn, K as take, X as takeMaybe } from './io-40341e1a.js';
import '@redux-saga/delay-p';

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

@@ -8,3 +8,3 @@ 'use strict';

var is = require('@redux-saga/is');
var io = require('./io-d7550be2.js');
var io = require('./io-0d26a232.js');
require('@redux-saga/delay-p');

@@ -11,0 +11,0 @@

{
"name": "@redux-saga/core",
"version": "1.1.3",
"version": "1.2.0",
"description": "Saga middleware for Redux to handle Side Effects",

@@ -10,4 +10,19 @@ "main": "./dist/redux-saga-core.cjs.js",

"effects",
"types"
"types",
"import-condition-proxy.mjs"
],
"exports": {
"./effects": {
"types": "./types/ts3.6/effects.d.ts",
"module": "./dist/redux-saga-effects.esm.js",
"default": "./dist/redux-saga-effects.cjs.js"
},
".": {
"types": "./types/ts3.6/index.d.ts",
"module": "./dist/redux-saga-core.esm.js",
"import": "./import-condition-proxy.mjs",
"default": "./dist/redux-saga-core.cjs.js"
},
"./package.json": "./package.json"
},
"scripts": {

@@ -24,3 +39,3 @@ "test": "yarn test:types && yarn test:jest",

},
"repository": "https://github.com/redux-saga/redux-saga/tree/master/packages/core",
"repository": "https://github.com/redux-saga/redux-saga/tree/main/packages/core",
"keywords": [

@@ -46,9 +61,13 @@ "javascript",

"homepage": "https://redux-saga.js.org/",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/redux-saga"
},
"dependencies": {
"@babel/runtime": "^7.6.3",
"@redux-saga/deferred": "^1.1.2",
"@redux-saga/delay-p": "^1.1.2",
"@redux-saga/deferred": "^1.2.0",
"@redux-saga/delay-p": "^1.2.0",
"@redux-saga/is": "^1.1.2",
"@redux-saga/symbols": "^1.1.2",
"@redux-saga/types": "^1.1.0",
"@redux-saga/types": "^1.2.0",
"redux": "^4.0.4",

@@ -64,3 +83,3 @@ "typescript-tuple": "^2.2.1"

"babel-plugin-annotate-pure-calls": "^0.4.0",
"dtslint": "^0.9.0",
"dtslint": "3.5.2",
"jest": "^23.5.0",

@@ -89,4 +108,3 @@ "lerna-alias": "^3.0.2",

}
},
"gitHead": "d1c9aa3c92f7b1b25b610eb5fe2df4d245f27ecd"
}
}

@@ -62,2 +62,19 @@ import {

c1.close();
// Testing that we can't define channels that pass void or undefined
// $ExpectError
const voidChannel: Channel<void> = channel();
// $ExpectError
const voidChannel2 = channel<void>();
// $ExpectError
const undefinedChannel = channel<undefined>();
// $ExpectError
channel().put();
// $ExpectError
channel().put(undefined);
// Testing that we can pass primitives into channels
channel().put(42);
channel().put('test');
channel().put(true);
}

@@ -104,2 +121,17 @@

c1.close();
// $ExpectError
const c4: EventChannel<void> = eventChannel(() => () => {})
// $ExpectError
const c5 = eventChannel<void>(emit => {
emit()
return () => {}
})
const c6 = eventChannel(emit => {
// $ExpectError
emit()
return () => {}
})
}

@@ -126,2 +158,9 @@

c1.close();
// $ExpectError
const c3: MulticastChannel<void> = stdChannel()
// $ExpectError
const c4 = multicastChannel<void>()
// $ExpectError
const c5 = stdChannel<void>()
}

@@ -365,3 +365,3 @@ import { Action, AnyAction } from 'redux'

*
* @param action [see Redux `dispatch` documentation for complete info](http://redux.js.org/docs/api/Store.html#dispatch)
* @param action [see Redux `dispatch` documentation for complete info](https://redux.js.org/api/store#dispatchaction)
*/

@@ -375,3 +375,3 @@ export function put<A extends Action>(action: A): PutEffect<A>

*
* @param action [see Redux `dispatch` documentation for complete info](http://redux.js.org/docs/api/Store.html#dispatch)
* @param action [see Redux `dispatch` documentation for complete info](https://redux.js.org/api/store#dispatchaction)
*/

@@ -397,3 +397,3 @@ export function putResolve<A extends Action>(action: A): PutEffect<A>

* @param channel a `Channel` Object.
* @param action [see Redux `dispatch` documentation for complete info](http://redux.js.org/docs/api/Store.html#dispatch)
* @param action [see Redux `dispatch` documentation for complete info](https://redux.js.org/api/store#dispatchaction)
*/

@@ -400,0 +400,0 @@ export function put<T>(channel: PuttableChannel<T>, action: T | END): ChannelPutEffect<T>

@@ -291,2 +291,5 @@ import { SagaIterator, Channel, EventChannel, MulticastChannel, Task, Buffer, END, buffers, detach } from 'redux-saga'

// $ExpectError
yield cps((a: number, b: string) => {}, 42)
yield cps(cb => {

@@ -378,2 +381,6 @@ cb(null, 1)

}
const objWithoutCb = {
foo: 'bar',
getFoo(arg: string) {},
}

@@ -388,2 +395,4 @@ // $ExpectError

yield cps<typeof obj, (arg: string, cb: Cb<string>) => void>([obj, obj.getFoo], 'bar')
// $ExpectError
yield cps([objWithoutCb, objWithoutCb.getFoo])

@@ -398,2 +407,4 @@ // $ExpectError

yield cps<typeof obj, 'getFoo'>([obj, 'getFoo'], 'bar')
// $ExpectError
yield cps([objWithoutCb, 'getFoo'])

@@ -407,2 +418,4 @@ // $ExpectError

yield cps<typeof obj, (arg: string, cb: Cb<string>) => void>({ context: obj, fn: obj.getFoo }, 'bar')
// $ExpectError
yield cps({ context: objWithoutCb, fn: objWithoutCb.getFoo })

@@ -417,2 +430,4 @@ // $ExpectError

yield cps<typeof obj, 'getFoo'>({ context: obj, fn: 'getFoo' }, 'bar')
// $ExpectError
yield cps({ context: objWithoutCb, fn: 'getFoo' })
}

@@ -419,0 +434,0 @@

// TypeScript Version: 3.2
import { Action, Middleware } from 'redux'
import { Saga, Buffer, Channel, END as EndType, Predicate, SagaIterator, Task } from '@redux-saga/types'
import { Saga, Buffer, Channel, END as EndType, Predicate, SagaIterator, Task, NotUndefined } from '@redux-saga/types'
import { ForkEffect } from './effects'

@@ -268,3 +268,3 @@

*/
export function channel<T>(buffer?: Buffer<T>): Channel<T>
export function channel<T extends NotUndefined>(buffer?: Buffer<T>): Channel<T>

@@ -310,3 +310,3 @@ /**

*/
export function eventChannel<T>(subscribe: Subscribe<T>, buffer?: Buffer<T>): EventChannel<T>
export function eventChannel<T extends NotUndefined>(subscribe: Subscribe<T>, buffer?: Buffer<T>): EventChannel<T>

@@ -316,3 +316,3 @@ export type Subscribe<T> = (cb: (input: T | END) => void) => Unsubscribe

export interface EventChannel<T> {
export interface EventChannel<T extends NotUndefined> {
take(cb: (message: T | END) => void): void

@@ -327,3 +327,3 @@ flush(cb: (items: T[] | END) => void): void

export interface MulticastChannel<T> {
export interface MulticastChannel<T extends NotUndefined> {
take(cb: (message: T | END) => void, matcher?: Predicate<T>): void

@@ -334,4 +334,4 @@ put(message: T | END): void

export function multicastChannel<T>(): MulticastChannel<T>
export function stdChannel<T>(): MulticastChannel<T>
export function multicastChannel<T extends NotUndefined>(): MulticastChannel<T>
export function stdChannel<T extends NotUndefined>(): MulticastChannel<T>

@@ -338,0 +338,0 @@ export function detach(forkEffect: ForkEffect): ForkEffect

@@ -62,2 +62,20 @@ import {

c1.close();
// Testing that we can't define channels that pass void or undefined
// $ExpectError
const voidChannel: Channel<void> = channel();
// $ExpectError
const voidChannel2 = channel<void>();
// $ExpectError
const undefinedChannel = channel<undefined>();
// $ExpectError
channel().put();
// $ExpectError
channel().put(undefined);
// Testing that we can pass primitives into channels
channel().put(null);
channel().put(42);
channel().put('test');
channel().put(true);
}

@@ -104,2 +122,17 @@

c1.close();
// $ExpectError
const c4: EventChannel<void> = eventChannel(() => () => {})
// $ExpectError
const c5 = eventChannel<void>(emit => {
emit()
return () => {}
})
const c6 = eventChannel(emit => {
// $ExpectError
emit()
return () => {}
})
}

@@ -110,2 +143,8 @@

const c2: MulticastChannel<{foo: string}> = stdChannel<{foo: string}>();
// $ExpectError
const c3: MulticastChannel<void> = stdChannel()
// $ExpectError
const c4 = multicastChannel<void>()
// $ExpectError
const c5 = stdChannel<void>()

@@ -112,0 +151,0 @@ // $ExpectError

@@ -384,3 +384,3 @@ import { Action, AnyAction } from 'redux'

*
* @param action [see Redux `dispatch` documentation for complete info](http://redux.js.org/docs/api/Store.html#dispatch)
* @param action [see Redux `dispatch` documentation for complete info](https://redux.js.org/api/store#dispatchaction)
*/

@@ -394,3 +394,3 @@ export function put<A extends Action>(action: A): PutEffect<A>

*
* @param action [see Redux `dispatch` documentation for complete info](http://redux.js.org/docs/api/Store.html#dispatch)
* @param action [see Redux `dispatch` documentation for complete info](https://redux.js.org/api/store#dispatchaction)
*/

@@ -416,3 +416,3 @@ export function putResolve<A extends Action>(action: A): PutEffect<A>

* @param channel a `Channel` Object.
* @param action [see Redux `dispatch` documentation for complete info](http://redux.js.org/docs/api/Store.html#dispatch)
* @param action [see Redux `dispatch` documentation for complete info](https://redux.js.org/api/store#dispatchaction)
*/

@@ -535,2 +535,8 @@ export function put<T>(channel: PuttableChannel<T>, action: T | END): ChannelPutEffect<T>

type Cast<A, B> = A extends B ? A : B
type AnyFunction = (...args: any[]) => any
type RequireCpsCallback<Fn extends (...args: any[]) => any> = Last<Parameters<Fn>> extends CpsCallback<any> ? Fn : never
type RequireCpsNamedCallback<Ctx, Name extends keyof Ctx> = Last<Parameters<Cast<Ctx[Name], AnyFunction>>> extends CpsCallback<any> ? Name : never
/**

@@ -549,4 +555,4 @@ * Creates an Effect description that instructs the middleware to invoke `fn` as

export function cps<Fn extends (...args: any[]) => any>(
fn: Fn,
...args: CpsFunctionParameters<Fn>
fn: RequireCpsCallback<Fn>,
...args: AllButLast<Parameters<Fn>>
): CpsEffect<ReturnType<Fn>>

@@ -559,4 +565,4 @@ /**

export function cps<Ctx extends { [P in Name]: (this: Ctx, ...args: any[]) => void }, Name extends string>(
ctxAndFnName: [Ctx, Name],
...args: CpsFunctionParameters<Ctx[Name]>
ctxAndFnName: [Ctx, RequireCpsNamedCallback<Ctx, Name>],
...args: AllButLast<Parameters<Ctx[Name]>>
): CpsEffect<ReturnType<Ctx[Name]>>

@@ -570,4 +576,4 @@ /**

export function cps<Ctx extends { [P in Name]: (this: Ctx, ...args: any[]) => void }, Name extends string>(
ctxAndFnName: { context: Ctx; fn: Name },
...args: CpsFunctionParameters<Ctx[Name]>
ctxAndFnName: { context: Ctx; fn: RequireCpsNamedCallback<Ctx, Name> },
...args: AllButLast<Parameters<Ctx[Name]>>
): CpsEffect<ReturnType<Ctx[Name]>>

@@ -579,4 +585,4 @@ /**

export function cps<Ctx, Fn extends (this: Ctx, ...args: any[]) => void>(
ctxAndFn: [Ctx, Fn],
...args: CpsFunctionParameters<Fn>
ctxAndFn: [Ctx, RequireCpsCallback<Fn>],
...args: AllButLast<Parameters<Fn>>
): CpsEffect<ReturnType<Fn>>

@@ -590,4 +596,4 @@ /**

export function cps<Ctx, Fn extends (this: Ctx, ...args: any[]) => void>(
ctxAndFn: { context: Ctx; fn: Fn },
...args: CpsFunctionParameters<Fn>
ctxAndFn: { context: Ctx; fn: RequireCpsCallback<Fn> },
...args: AllButLast<Parameters<Fn>>
): CpsEffect<ReturnType<Fn>>

@@ -594,0 +600,0 @@

@@ -291,2 +291,5 @@ import { SagaIterator, Channel, EventChannel, MulticastChannel, Task, Buffer, END, buffers, detach } from 'redux-saga'

// $ExpectError
yield cps((a: number, b: string) => {}, 42)
yield cps(cb => {

@@ -378,2 +381,6 @@ cb(null, 1)

}
const objWithoutCb = {
foo: 'bar',
getFoo(arg: string) {},
}

@@ -388,2 +395,4 @@ // $ExpectError

yield cps<typeof obj, (arg: string, cb: Cb<string>) => void>([obj, obj.getFoo], 'bar')
// $ExpectError
yield cps([objWithoutCb, objWithoutCb.getFoo])

@@ -398,2 +407,4 @@ // $ExpectError

yield cps<typeof obj, 'getFoo'>([obj, 'getFoo'], 'bar')
// $ExpectError
yield cps([objWithoutCb, 'getFoo'])

@@ -407,2 +418,4 @@ // $ExpectError

yield cps<typeof obj, (arg: string, cb: Cb<string>) => void>({ context: obj, fn: obj.getFoo }, 'bar')
// $ExpectError
yield cps({ context: objWithoutCb, fn: objWithoutCb.getFoo })

@@ -417,2 +430,4 @@ // $ExpectError

yield cps<typeof obj, 'getFoo'>({ context: obj, fn: 'getFoo' }, 'bar')
// $ExpectError
yield cps({ context: objWithoutCb, fn: 'getFoo' })
}

@@ -419,0 +434,0 @@

import { Action, Middleware } from 'redux'
import { Saga, Buffer, Channel, END as EndType, Predicate, SagaIterator, Task } from '@redux-saga/types'
import { Saga, Buffer, Channel, END as EndType, Predicate, SagaIterator, Task, NotUndefined } from '@redux-saga/types'
import { ForkEffect } from './effects'

@@ -267,3 +267,3 @@

*/
export function channel<T>(buffer?: Buffer<T>): Channel<T>
export function channel<T extends NotUndefined>(buffer?: Buffer<T>): Channel<T>

@@ -309,3 +309,3 @@ /**

*/
export function eventChannel<T>(subscribe: Subscribe<T>, buffer?: Buffer<T>): EventChannel<T>
export function eventChannel<T extends NotUndefined>(subscribe: Subscribe<T>, buffer?: Buffer<T>): EventChannel<T>

@@ -315,3 +315,3 @@ export type Subscribe<T> = (cb: (input: T | END) => void) => Unsubscribe

export interface EventChannel<T> {
export interface EventChannel<T extends NotUndefined> {
take(cb: (message: T | END) => void): void

@@ -326,3 +326,3 @@ flush(cb: (items: T[] | END) => void): void

export interface MulticastChannel<T> {
export interface MulticastChannel<T extends NotUndefined> {
take(cb: (message: T | END) => void, matcher?: Predicate<T>): void

@@ -333,4 +333,4 @@ put(message: T | END): void

export function multicastChannel<T>(): MulticastChannel<T>
export function stdChannel<T>(): MulticastChannel<T>
export function multicastChannel<T extends NotUndefined>(): MulticastChannel<T>
export function stdChannel<T extends NotUndefined>(): MulticastChannel<T>

@@ -337,0 +337,0 @@ export function detach(forkEffect: ForkEffect): ForkEffect

@@ -6,3 +6,2 @@ {

"moduleResolution": "node",
"noImplicitAny": true,
"strict": true,

@@ -9,0 +8,0 @@ "baseUrl": ".",

@@ -6,3 +6,2 @@ {

"moduleResolution": "node",
"noImplicitAny": true,
"strict": true,

@@ -9,0 +8,0 @@ "baseUrl": ".",

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