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

redux-starter-kit

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-starter-kit - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

4

dist/redux-starter-kit.cjs.js

@@ -352,2 +352,6 @@ 'use strict';

/**
* An action creator atttached to a slice.
*/
function getType$1(slice, actionKey) {

@@ -354,0 +358,0 @@ return slice ? "".concat(slice, "/").concat(actionKey) : actionKey;

@@ -348,2 +348,6 @@ import { combineReducers, applyMiddleware, createStore, compose } from 'redux';

/**
* An action creator atttached to a slice.
*/
function getType$1(slice, actionKey) {

@@ -350,0 +354,0 @@ return slice ? "".concat(slice, "/").concat(actionKey) : actionKey;

2

package.json
{
"name": "redux-starter-kit",
"version": "0.4.1",
"version": "0.4.2",
"description": "A simple set of tools to make using Redux easier",

@@ -5,0 +5,0 @@ "repository": "https://github.com/markerikson/redux-starter-kit",

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

import { Action, AnyAction, ActionCreator, Reducer } from 'redux'
import { Action, AnyAction, Reducer } from 'redux'
import { createAction, PayloadAction } from './createAction'

@@ -6,6 +6,11 @@ import { createReducer, CaseReducersMapObject } from './createReducer'

/**
* An action creator atttached to a slice.
*/
export type SliceActionCreator<P> = (payload: P) => PayloadAction<P>
export interface Slice<
S = any,
A extends Action = AnyAction,
AT extends string = string
AP extends { [key: string]: any } = { [key: string]: any }
> {

@@ -26,3 +31,3 @@ /**

*/
actions: { [type in AT]: ActionCreator<A> }
actions: { [type in keyof AP]: SliceActionCreator<AP[type]> }

@@ -73,2 +78,14 @@ /**

type ExtractPayloads<
S,
A extends PayloadAction,
CR extends CaseReducersMapObject<S, A>
> = {
[type in keyof CR]: CR[type] extends (state: S) => any
? void
: (CR[type] extends (state: S, action: PayloadAction<infer P>) => any
? P
: never)
}
function getType(slice: string, actionKey: string): string {

@@ -88,7 +105,7 @@ return slice ? `${slice}/${actionKey}` : actionKey

S = any,
A extends PayloadAction = PayloadAction,
A extends PayloadAction = PayloadAction<any>,
CR extends CaseReducersMapObject<S, A> = CaseReducersMapObject<S, A>
>(
options: CreateSliceOptions<S, A, CR>
): Slice<S, A, Extract<keyof CR, string>> {
): Slice<S, A, ExtractPayloads<S, A, CR>> {
const { slice = '', initialState } = options

@@ -95,0 +112,0 @@ const reducers = options.reducers || {}

Sorry, the diff of this file is too big to display

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