Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd2c6478

Browse files
authored
Simplify the empty epic to actually do nothing
The current `emptyEpic` could create an infinite loop if an end user actually dispatched an element of type `noop`. Using `ignoreElements` instead will just sink all actions.
1 parent163377f commitd2c6478

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

‎packages/redux-dynamic-modules-observable/src/EpicManager.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import{getObjectRefCounter,IItemManager}from"redux-dynamic-modules-core";
22
import{Epic,ofType,EpicMiddleware}from"redux-observable";
33
import{Observable,Subject}from"rxjs";
4-
import{mapTo,switchMap}from"rxjs/operators";
4+
import{ignoreElements,switchMap}from"rxjs/operators";
55

66
exportinterfaceIEpicManagerextendsIItemManager<Epic>{
77
// some extra properties
@@ -121,7 +121,6 @@ function createReplaceableWrapper() {
121121
*/
122122
functionemptyEpic(action$){
123123
returnaction$.pipe(
124-
ofType("noop"),
125-
mapTo({type:"noop"})
124+
ignoreElements()
126125
);
127126
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp