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

manageMaps

Generic types:T

Helper function that updates the maps used in update-effect.function.ts so we can implement optimistic updates and can rollback on error when needed.

Presentation

function manageMaps(
  lastRow: Map<string, T>,
  lastRowTimeout: Map<string, number>,
  action: { old: RowProp<T>; new: RowProp<T> },
): void;

Returns

void

Parameters

NameTypeDescription
lastRow
Map<string, T>

the map of the last row sent to the server

lastRowTimeout
Map<string, number>

the map of the last time a row was sent to the server

action
{ old: RowProp<T>; new: RowProp<T>; }

the action that was dispatched