npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cet-redux-saga-toolkit

v1.0.2

Published

Safe effect wrapper and testing utilites for redux-saga

Downloads

4

Readme

redux-saga-toolkit

redux-saga-toolkit

Table of contents

Interfaces

Type Aliases

Variables

Functions

Type Aliases

ArgumentSelector

Ƭ ArgumentSelector<Selector>: (...args: any[]) => Selector

Type parameters

| Name | | :------ | | Selector |

Type declaration

▸ (...args): Selector

Parameters

| Name | Type | | :------ | :------ | | ...args | any[] |

Returns

Selector

Defined in

src/types/index.ts:16


GenericSelector

Ƭ GenericSelector<State, Result>: (state: State) => Result

Type parameters

| Name | | :------ | | State | | Result |

Type declaration

▸ (state): Result

Parameters

| Name | Type | | :------ | :------ | | state | State |

Returns

Result

Defined in

src/types/index.ts:15


HOC

Ƭ HOC: FC<{}>

Defined in

src/types/index.ts:5


commonState

Ƭ commonState: ReturnType<typeof commonReducer>

Defined in

src/state/commonReducer.ts:10

Variables

errorSlice

Const errorSlice: Slice<errorState, { clearError: (state: errorState, __namedParameters: { payload: string ; type: string }) => {} ; resetErrors: () => {} ; setError: (state: errorState, __namedParameters: { payload: IErrorDetailsPayload ; type: string }) => {} }, "errorSlice", "errorSlice", SliceSelectors<errorState>>

Defined in

src/state/errorSlice.ts:16


loadingSlice

Const loadingSlice: Slice<loadingState, { resetLoading: () => {} ; setLoading: (state: loadingState, __namedParameters: { payload: string ; type: string }) => {} ; unsetLoading: (state: loadingState, __namedParameters: { payload: string ; type: string }) => {} }, "loadingSlice", "loadingSlice", SliceSelectors<loadingState>>

Defined in

src/state/loadingSlice.ts:6

Functions

commonReducer

commonReducer(state, action): Object

A reducer is a function that accepts an accumulation and a value and returns a new accumulation. They are used to reduce a collection of values down to a single value

Reducers are not unique to Redux—they are a fundamental concept in functional programming. Even most non-functional languages, like JavaScript, have a built-in API for reducing. In JavaScript, it's Array.prototype.reduce().

In Redux, the accumulated value is the state object, and the values being accumulated are actions. Reducers calculate a new state given the previous state and an action. They must be pure functions—functions that return the exact same output for given inputs. They should also be free of side-effects. This is what enables exciting features like hot reloading and time travel.

Reducers are the most important concept in Redux.

Do not put API calls into reducers.

Parameters

| Name | Type | | :------ | :------ | | state | { error: errorState = errorSlice.reducer; loading: loadingState = loadingSlice.reducer } | Partial<{ error: errorState = errorSlice.reducer; loading: loadingState = loadingSlice.reducer }> | | action | UnknownAction |

Returns

Object

| Name | Type | | :------ | :------ | | error | errorState | | loading | loadingState |

Defined in

node_modules/redux/dist/redux.d.ts:91


createCommand

createCommand<Payload>(name, saga): Object

Type parameters

| Name | | :------ | | Payload |

Parameters

| Name | Type | | :------ | :------ | | name | string | | saga | (action: { payload: Payload ; type: string }) => Generator<any, void, never> |

Returns

Object

| Name | Type | | :------ | :------ | | action | IsAny<Payload, ActionCreatorWithPayload<any, string>, IsUnknown<Payload, ActionCreatorWithNonInferrablePayload<string>, IfVoid<Payload, ActionCreatorWithoutPayload<string>, IfMaybeUndefined<Payload, ActionCreatorWithOptionalPayload<Payload, string>, ActionCreatorWithPayload<Payload, string>>>>> | | saga | (action: { payload: Payload ; type: string }) => Generator<any, void, never> |

Defined in

src/createCommand/createCommand.ts:7


createHOCDecorator

createHOCDecorator<State>(storeCreator): Object

Type parameters

| Name | Type | | :------ | :------ | | State | extends Object |

Parameters

| Name | Type | | :------ | :------ | | storeCreator | StoreCreator<State> |

Returns

Object

| Name | Type | | :------ | :------ | | HocDecorator | (Story: AnnotatedStoryFn<ReactRenderer, any>) => Element | | store | ExtendedStore<State> | | useSetTestState | (stateDiff: Partial<State>) => void |

Defined in

src/HOCDecorator/index.ts:10


makeStoreCreator

makeStoreCreator<State>(reducer, rootSaga): StoreCreator<State>

Type parameters

| Name | Type | | :------ | :------ | | State | extends Object |

Parameters

| Name | Type | | :------ | :------ | | reducer | Reducer<State> | | rootSaga | () => Generator<any, any, unknown> |

Returns

StoreCreator<State>

Defined in

src/testing/utils.ts:54


takeLatestCommandSafe

takeLatestCommandSafe(command): Generator<Generator<ForkEffect<void>, void, unknown>, void, unknown>

Parameters

| Name | Type | Default value | | :------ | :------ | :------ | | command | Object | undefined | | command.action | ActionCreatorWithNonInferrablePayload<string> | actionCreator | | command.saga | (action: { payload: unknown ; type: string }) => Generator<any, void, never> | undefined |

Returns

Generator<Generator<ForkEffect<void>, void, unknown>, void, unknown>

Defined in

src/createCommand/safeEffect.ts:64


takeLatestSafe

takeLatestSafe(actionType, saga): Generator<ForkEffect<void>, void, unknown>

Parameters

| Name | Type | | :------ | :------ | | actionType | string | | saga | (action: any) => Generator<any, any, unknown> |

Returns

Generator<ForkEffect<void>, void, unknown>

Defined in

src/createCommand/safeEffect.ts:52


watchCommandChapter

watchCommandChapter(chapterExports): () => Generator<AllEffect<Generator<Generator<ForkEffect<void>, void, unknown>, void, unknown>>, void, unknown>

Parameters

| Name | Type | | :------ | :------ | | chapterExports | commandChapter |

Returns

fn

▸ (): Generator<AllEffect<Generator<Generator<ForkEffect<void>, void, unknown>, void, unknown>>, void, unknown>

Returns

Generator<AllEffect<Generator<Generator<ForkEffect<void>, void, unknown>, void, unknown>>, void, unknown>

Defined in

src/createCommand/createCommand.ts:25