Skip to content

Commit

Permalink
fix(effects): export CreateEffectMetadata (#2245)
Browse files Browse the repository at this point in the history
Closes #2243
  • Loading branch information
alex-okrushko authored and timdeschryver committed Nov 12, 2019
1 parent 90d0602 commit bfe4c81
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
14 changes: 7 additions & 7 deletions modules/effects/src/effect_creator.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Observable } from 'rxjs';
import { Action } from '@ngrx/store';
import { EffectMetadata, EffectConfig, DEFAULT_EFFECT_CONFIG } from './models';

const CREATE_EFFECT_METADATA_KEY = '__@ngrx/effects_create__';

interface CreateEffectMetadata {
[CREATE_EFFECT_METADATA_KEY]: EffectConfig;
}
import {
EffectMetadata,
EffectConfig,
DEFAULT_EFFECT_CONFIG,
CreateEffectMetadata,
CREATE_EFFECT_METADATA_KEY,
} from './models';

type DispatchType<T> = T extends { dispatch: infer U } ? U : true;
type ObservableType<T, OriginalType> = T extends false ? OriginalType : Action;
Expand Down
7 changes: 2 additions & 5 deletions modules/effects/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ export { EffectConfig } from './models';
export { Effect } from './effect_decorator';
export { getEffectsMetadata } from './effects_metadata';
export { mergeEffects } from './effects_resolver';
export { EffectsMetadata } from './models';
export { EffectsMetadata, CreateEffectMetadata } from './models';
export { Actions, ofType } from './actions';
export { EffectsModule } from './effects_module';
export { EffectSources } from './effect_sources';
export { EffectNotification } from './effect_notification';
export {
ROOT_EFFECTS_INIT,
rootEffectsInit,
} from './effects_root_module';
export { ROOT_EFFECTS_INIT, rootEffectsInit } from './effects_root_module';
export { act } from './act';
export {
OnIdentifyEffects,
Expand Down
6 changes: 6 additions & 0 deletions modules/effects/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export const DEFAULT_EFFECT_CONFIG: Readonly<Required<EffectConfig>> = {
resubscribeOnError: true,
};

export const CREATE_EFFECT_METADATA_KEY = '__@ngrx/effects_create__';

export interface CreateEffectMetadata {
[CREATE_EFFECT_METADATA_KEY]: EffectConfig;
}

export type EffectPropertyKey<T extends Object> = Exclude<
keyof T,
keyof Object
Expand Down

0 comments on commit bfe4c81

Please sign in to comment.