Gathering detailed insights and metrics for typesafe-actions-reducer-builder
Gathering detailed insights and metrics for typesafe-actions-reducer-builder
Gathering detailed insights and metrics for typesafe-actions-reducer-builder
Gathering detailed insights and metrics for typesafe-actions-reducer-builder
Typescript reducer builder for typesafe-actions, including immer for reducer's output
npm install typesafe-actions-reducer-builder
Typescript
Module System
Node Version
NPM Version
66.6
Supply Chain
94.5
Quality
74.8
Maintenance
100
Vulnerability
100
License
TypeScript (96.55%)
JavaScript (3.45%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
2 Stars
4 Commits
2 Watchers
12 Branches
1 Contributors
Updated on Sep 23, 2020
Latest Version
1.0.0
Package Id
typesafe-actions-reducer-builder@1.0.0
Unpacked Size
25.08 kB
Size
7.14 kB
File Count
16
NPM Version
6.9.0
Node Version
12.2.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
6
This library provides the function createReducerBuilder
: it's a 100% type-hinted builder which creates a redux reducer for a particular state
allowing the developer to define reducers per-action basis. It uses the typesafe-actions
library to interact with the actions.
Immutable<TState>
using immer
, always providing immutable states to redux1// myReducer.ts 2 3import createReducerBuilder from 'typesafe-actions-reducer-builder' 4 5// Those are all typesafe-actions actions 6import { 7 metaAuthorChangeAction, // PayloadAction<string, string> 8 metaTitleChangeAction, // PayloadAction<string, string> 9 metaDescriptionChangeAction, // PayloadAction<string, string> 10 metaTagsAddAction, // PayloadAction<string, string> 11 metaTagsRemoveAction, // PayloadAction<string, string> 12 bodyChangeAction, // PayloadAction<string, string> 13} from './actions.ts' 14 15interface DocumentState { 16 meta: { 17 author: string 18 title: string 19 description: string 20 tags: string[] 21 } 22 body: string 23} 24 25const initialState: DocumentState { 26 meta: { 27 author: '', 28 title: '', 29 description: '', 30 tags: [], 31 }, 32 body: '' 33} 34 35 36const reducer = createReducerBuilder(initialState) 37 // reducer's type: Reducer<DocumentState, PayloadAction<string, string>> 38 .handle(metaAuthorChangeAction).reducer((state = initialState, action) => { 39 state.meta.author = action.payload 40 return state 41 }) 42 .handle(metaTitleChangeAction).reducer((state = initialState, action) => { 43 state.meta.title = action.payload 44 return state 45 }) 46 .handle(metaDescriptionChangeAction).reducer((state = initialState, action) => { 47 state.meta.description = action.payload 48 return state 49 }) 50 .handle(metaTagsAddAction).reducer((state = initialState, action) => { 51 if (!state.meta.tags.includes(action.payload)) { 52 state.meta.tags.push(action.payload) 53 } 54 return state 55 }) 56 .handle(metaTagsRemoveAction).reducer((state = initialState, action) => { 57 if (!state.meta.tags.includes(action.payload)) { 58 return 59 } 60 state.meta.tags.splice(state.meta.tags.indexOf(action.payload), 1) 61 return state 62 }) 63 .handle(bodyChangeAction).reducer((state = initialState, action) => { 64 state.body = action.payload 65 return state 66 }) 67 .build() 68 69export default reducer 70
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/2 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
27 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More