Skip to content
This repository was archived by the owner on Jul 8, 2021. It is now read-only.

Commit cc55383

Browse files
author
Austin McDaniel
committed
fix: effects not unsunscribing
1 parent 23b0966 commit cc55383

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 3.1.5 - 2/27/18
2+
- Fix: Effects not unsubscribing
3+
14
# 3.1.4 - 2/27/18
25
- Feature: Effects can return array objects
36

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ngrx-actions",
3-
"version": "3.1.4",
3+
"version": "3.1.5",
44
"description": "Actions and Reducer Utility Library for NGRX",
55
"main": "dist/index.js",
66
"scripts": {

src/factory.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Action } from '@ngrx/store';
22
import { NGRX_ACTIONS_META, StoreMetadata } from './internals';
33
import { NgrxSelect } from './select';
4+
import { take } from 'rxjs/operators';
45

56
export function createReducer<TState = any>(
67
store:
@@ -38,7 +39,7 @@ export function createReducer<TState = any>(
3839
const retVal = instance[effectMeta.fn](state, action);
3940
if (retVal) {
4041
if (retVal.subscribe) {
41-
retVal.subscribe(res => {
42+
retVal.pipe(take(1)).subscribe(res => {
4243
if (Array.isArray(res)) {
4344
res.forEach(r => NgrxSelect.store && NgrxSelect.store.dispatch(r));
4445
} else if (NgrxSelect.store) {

0 commit comments

Comments
 (0)