Gathering detailed insights and metrics for redux-epics-decorator
Gathering detailed insights and metrics for redux-epics-decorator
Gathering detailed insights and metrics for redux-epics-decorator
Gathering detailed insights and metrics for redux-epics-decorator
Dumb decorators for redux & redux-observable & react-redux & redux-actions
npm install redux-epics-decorator
Typescript
Module System
Node Version
NPM Version
TypeScript (93%)
JavaScript (6.43%)
HTML (0.57%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
58 Stars
789 Commits
7 Forks
3 Watchers
21 Branches
7 Contributors
Updated on Jul 05, 2025
Latest Version
0.10.10
Package Id
redux-epics-decorator@0.10.10
Unpacked Size
101.78 kB
Size
19.47 kB
File Count
116
NPM Version
6.13.4
Node Version
12.14.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
2
7
57
A Dumb wrapper for redux 💚 redux-observable 💚 react-redux 💚 redux-actions 💚 injection-js
Action Types
but which more important is:
yarn add redux redux-observable rxjs redux-actions react-redux
yarn add redux-epics-decorator
Use yarn && yarn start
to play with it.
1// module.ts 2import { Action } from 'redux-actions' 3import { ActionsObservable } from 'redux-observable' 4import { Observable } from 'rxjs' 5import { exhaustMap, takeUntil } from 'rxjs/operators' 6 7import { generateMsg, Msg } from '../service' 8import { EffectModule, Module, Effect, Reducer, ModuleActionProps, DefineAction } from 'redux-epics-decorator' 9 10export interface StateProps { 11 currentMsgId: string | null 12 allMsgs: Msg[] 13} 14 15@Module('your_module_name') 16export class Module1 extends EffectModule<StateProps> { 17 readonly defaltState: StateProps = { 18 currentMsgId: null, 19 allMsgs: [] 20 } 21 22 @DefineAction('dispose') dispose: Observable<void> 23 24 @Effect({ 25 success: (state: StateProps, { payload }: Action<Msg>) => { 26 const { allMsgs } = state 27 return { ...state, allMsgs: allMsgs.concat([payload!]) } 28 } 29 }) 30 getMsg(action$: Observable<void>) { 31 return action$.pipe( 32 exhaustMap(() => generateMsg().pipe( 33 takeUntil(this.dispose), 34 map(this.createAction('success')), // up in Effect Decorator 35 // dispatch a normal Redux Action 36 // intergrate to your existed redux system 37 endWith(this.markAsGlobal({ 38 type: 'notification', 39 payload: { 40 type: 'success', 41 msg: '✨ Get message success!' 42 } 43 })), 44 )) 45 ) 46 } 47 48 @Reducer('select_msg') 49 selectMsg(state: StateProps, { payload }: Action<string>) { 50 return { ...state, currentMsgId: payload } 51 } 52} 53 54export type DispatchProps = ModuleActionProps<Module1>
1// container.tsx 2import { Module1, StateProps, DispatchProps } from './module' 3 4interface OtherProps { 5 price: number 6 count: number 7} 8type Props = StateProps & OtherProps & DispatchProps 9 10const mapStateToProps = (state: GlobalState): StateProps => ({ 11 ...state.yourcomponent, 12 price: otherModule.price, 13 count: otherModule.count, 14}) 15 16class YourComponent extends React.PureComponent<Props> { 17 // your codes ... 18 19 render() { 20 // this is same to this.props.dispatch({ type: 'Module1/getMsg' }) 21 this.props.getMsg() // () => Action<void>, type safe here 22 return ( 23 <div /> 24 ) 25 } 26} 27 28export connect(Module1)(mapStateToProps)(YourComponent)
1// store 2import { combineModuleEpics, combineModuleReducers, createEpicMiddleware } from 'redux-epics-decorator' 3 4import { StateProps as YourComponentStateProps, Module1 } from './yourcomponent/module' 5 6interface GlobalState { 7 yourcomponent: YourComponentStateProps 8} 9 10const rootEpic = combineEpics( 11 combineModuleEpics( 12 Module1, 13 Module2, 14 Module3, 15 ), 16 // other normal epics from redux-observable 17 epic1, 18 epic2, 19 epic3, 20) 21 22 23const rootReducer = combineReducers({ 24 ...combineModuleReducers({ 25 module1: Module1, 26 module2: Module2, 27 module3: Module3, 28 }), 29 // other normal reducers from redux-actions 30 other1: otherReducers1, 31 other2: otherReducers2, 32}) 33 34const epicMiddleware = createEpicMiddleware() 35 36export default store = createStore<GlobalState>(rootReducer, compose<any>( 37 applyMiddleware( 38 epicMiddleware 39 ) 40)) 41 42epicMiddleware.run(rootEpic)
Please read Docs and recipe
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
85 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
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