### Using Redux Observable Decorators with Vanilla Redux Source: https://github.com/angular-redux/redux-observable-decorator/blob/master/README.md Provides an example of integrating `@Epic()` and `combineDecoratedEpics` with a vanilla Redux setup, demonstrating its applicability beyond Angular for managing epics. ```typescript class Test { @Epic() epic = (action$) => action$.ofType('TEST_IN').pipe(mapTo({ type: 'TEST_OUT' })); } const reducer = (state = [], action) => state.concat(action); const epics = new Test(); const epicMiddleware = createEpicMiddleware(epics); const store = createStore(reducer, applyMiddleware(epicMiddleware)); epicMiddleware.run(combineDecoratedEpics(epics)); ``` -------------------------------- ### Combining Decorated Epics in Angular with combineDecoratedEpics Source: https://github.com/angular-redux/redux-observable-decorator/blob/master/README.md Illustrates how to use `combineDecoratedEpics` from `redux-observable-decorator` to automatically gather and combine all `@Epic()` decorated epics from an instance, streamlining the setup of Redux Observable middleware in an Angular application. ```typescript import { combineDecoratedEpics } from 'redux-observable-decorator'; import { createEpicMiddleware } from 'redux-observable'; @NgModule({ }) export class AppModule { constructor(ngRedux:NgRedux, someEpics:SomeEpics) { let epics = combineDecoratedEpics(someEpics); const epicMiddleware = createEpicMiddleware(); ngRedux.configureStore(reducer,[epicMiddleware]); epicMiddleware.run(epics); } } ``` -------------------------------- ### Manually Combining Redux Observable Epics in Angular Source: https://github.com/angular-redux/redux-observable-decorator/blob/master/README.md Demonstrates the traditional approach of defining Redux Observable epics as methods in an injectable Angular class and manually combining them using `combineEpics` or creating individual middleware instances for store configuration. ```typescript @Injectable() export class SomeEpics { epicOne = (action$) => action$.ofType('PING').pipe(mapTo({type: 'PONG'})); epicTwo = (action$) => action$.ofType('ACTION_IN').pipe(mapTo({type: 'ACTION_OUT'})); } @NgModule({ }) export class AppModule { constructor(ngRedux: NgRedux, someEpics: SomeEpics) { let epics = combineEpics( someEpics.epicOne, someEpics.epicTwo ); let epicMiddleware = createEpicMidleware(); ngRedux.configureStore(reducer,[epicMiddleware]); epicMiddleware.run(epics); // or let epicOne = createMiddleware(someEpics.epicOne); let epicTwo = createMiddleware(someEpics.epicTwo); ngRedux.configureStore(reducer,[epicOne, epicTwo]); } } ``` -------------------------------- ### Decorating Redux Observable Epics with @Epic() Source: https://github.com/angular-redux/redux-observable-decorator/blob/master/README.md Shows how to use the `@Epic()` decorator from `redux-observable-decorator` to mark properties or methods as Redux Observable epics within an injectable Angular class, simplifying their identification and automatic combination. ```typescript import { Epic } from 'redux-observable-decorator'; @Injectable() export class SomeEpics { @Epic() epicOne = (action$) => action$.ofType('PING').pipe(mapTo({type: 'PONG'})); @Epic() epicTwo = (action$) => action$.ofType('ACTION_IN').pipe(mapTo({type: 'ACTION_OUT'})); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.