This repository was archived by the owner on Jul 8, 2021. It is now read-only.
Commit b97a9b8 Austin McDaniel
committed
1 parent cc55383 commit b97a9b8 Copy full SHA for b97a9b8
File tree 3 files changed +8
-7
lines changed
3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change
1
+ # 3.1.6 - 2/27/18
2
+ - Fix: Effects materialize vs take
3
+
1
4
# 3.1.5 - 2/27/18
2
5
- Fix: Effects not unsubscribing
3
6
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " ngrx-actions" ,
3
- "version" : " 3.1.5 " ,
3
+ "version" : " 3.1.6 " ,
4
4
"description" : " Actions and Reducer Utility Library for NGRX" ,
5
5
"main" : " dist/index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change 1
1
import { Action } from '@ngrx/store' ;
2
2
import { NGRX_ACTIONS_META , StoreMetadata } from './internals' ;
3
3
import { NgrxSelect } from './select' ;
4
- import { take } from 'rxjs/operators' ;
4
+ import { take , materialize } from 'rxjs/operators' ;
5
5
6
6
export function createReducer < TState = any > (
7
7
store :
@@ -39,11 +39,9 @@ export function createReducer<TState = any>(
39
39
const retVal = instance [ effectMeta . fn ] ( state , action ) ;
40
40
if ( retVal ) {
41
41
if ( retVal . subscribe ) {
42
- retVal . pipe ( take ( 1 ) ) . subscribe ( res => {
43
- if ( Array . isArray ( res ) ) {
44
- res . forEach ( r => NgrxSelect . store && NgrxSelect . store . dispatch ( r ) ) ;
45
- } else if ( NgrxSelect . store ) {
46
- NgrxSelect . store . dispatch ( res ) ;
42
+ retVal . pipe ( materialize ( ) ) . subscribe ( res => {
43
+ if ( res . value && NgrxSelect . store ) {
44
+ NgrxSelect . store . dispatch ( res . value ) ;
47
45
}
48
46
} ) ;
49
47
} else if ( NgrxSelect . store ) {
You can’t perform that action at this time.
0 commit comments