Home
Using Smart NgRX
Demo Walkthrough
API
@smarttools/smart-ngrx / Function

addEffect

Generic types:T

This is the effect that handles adding a new row to the store.

Presentation

function addEffect(
  effectServiceToken: InjectionToken<EffectService<T>>,
  actions: ActionGroup<T>,
): (
  actions$?: Actions<any>,
  effectService?: EffectService<T>,
) => Observable<
  | (Action<`[${any}] Add Success`> & {
      oldRow: T;
      newRow: T;
      feature: string;
      entity: string;
      parentId: string;
      parentFeature: string;
      parentEntityName: string;
    })
  | { type: string }
>;

Returns

(actions$?: Actions<any>, effectService?: EffectService<T>) => Observable<(Action<`[${any}] Add Success`> & { oldRow: T; newRow: T; feature: string; entity: string; parentId: string; parentFeature: string; parentEntityName: string; }) | { type: string; }> -

The effect that will be called when the action is triggered

Parameters

NameTypeDescription
effectServiceToken
InjectionToken<EffectService<T>>

the effect token for the service that will be called

actions
ActionGroup<T>

The action that will have the type of action that was triggered