Gathering detailed insights and metrics for redux-observable-decorator-es6-compat
Gathering detailed insights and metrics for redux-observable-decorator-es6-compat
Gathering detailed insights and metrics for redux-observable-decorator-es6-compat
Gathering detailed insights and metrics for redux-observable-decorator-es6-compat
npm install redux-observable-decorator-es6-compat
Typescript
Module System
Node Version
NPM Version
TypeScript (77.16%)
JavaScript (22.84%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
50 Commits
1 Branches
1 Contributors
Updated on Jan 20, 2023
Latest Version
1.0.0
Package Id
redux-observable-decorator-es6-compat@1.0.0
Unpacked Size
14.20 kB
Size
5.00 kB
File Count
13
NPM Version
6.9.0
Node Version
10.16.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
1
24
Decorators for Redux Observable
When using Redux with Angular with angular-redux/store and redux-observable, it's common to create your epics as an injectable class, and when configuring the store - creating an epic middleware for each one, or using combineEpics
:
1@Injectable()
2export class SomeEpics {
3 epicOne = (action$) => action$.ofType('PING').pipe(mapTo({type: 'PONG'}));
4 epicTwo = (action$) => action$.ofType('ACTION_IN').pipe(mapTo({type: 'ACTION_OUT'}));
5}
6
7@NgModule({
8
9})
10export class AppModule {
11 constructor(ngRedux: NgRedux, someEpics: SomeEpics) {
12 let epics = combineEpics(
13 someEpics.epicOne,
14 someEpics.epicTwo
15 );
16 let epicMiddleware = createEpicMidleware();
17
18 ngRedux.configureStore(reducer,[epicMiddleware]);
19 epicMiddleware.run(epics);
20
21 // or
22
23 let epicOne = createMiddleware(someEpics.epicOne);
24 let epicTwo = createMiddleware(someEpics.epicTwo);
25
26 ngRedux.configureStore(reducer,[epicOne, epicTwo]);
27 }
28}
This decorator is intended to make it easier to mark which properties / methods in a class are Epics to simplify creating the epic middleware for your application.
1import { Epic } from 'redux-observable-decorator'; 2 3@Injectable() 4export class SomeEpics { 5 @Epic() epicOne = (action$) => action$.ofType('PING').pipe(mapTo({type: 'PONG'})); 6 @Epic() epicTwo = (action$) => action$.ofType('ACTION_IN').pipe(mapTo({type: 'ACTION_OUT'})); 7}
1import { combineDecoratedEpics } from 'redux-observable-decorator'; 2import { createEpicMiddleware } from 'redux-observable'; 3 4@NgModule({ 5 6}) 7export class AppModule { 8 constructor(ngRedux:NgRedux, someEpics:SomeEpics) { 9 let epics = combineDecoratedEpics(someEpics); 10 const epicMiddleware = createEpicMiddleware(); 11 12 ngRedux.configureStore(reducer,[epicMiddleware]); 13 epicMiddleware.run(epics); 14 } 15}
This can be used with vanilla redux also - as seen in the unit tests...
1class Test {
2 @Epic() epic = (action$) => action$.ofType('TEST_IN').pipe(mapTo({ type: 'TEST_OUT' }));
3}
4
5const reducer = (state = [], action) => state.concat(action);
6const epics = new Test();
7const epicMiddleware = createEpicMiddleware(epics);
8const store = createStore(reducer, applyMiddleware(epicMiddleware));
9epicMiddleware.run(combineDecoratedEpics(epics));
The @Effect
decorator from ngrx/effects
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
project is archived
Details
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- 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
branch protection not enabled on development/release branches
Details
Reason
95 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