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

rowProxy

Generic types:T

Wraps a row in a proxy that will take care of editing the row and firing off the appropriate actions (via the services) to update the store and the server.

Note: this function will attempt to make the keys in the row writeable so if you are relying on NgRX to ensure these are not mutated, you will need to find some other way to do that.

Presentation

function rowProxy(
  row: T,
  service: ActionService,
  parentService: ActionService,
): RowProxyDelete & T;

Returns

RowProxyDelete & T -

a proxy that will handle updating the row but is typed as T and RowProxyDelete

Parameters

NameTypeDescription
row
T

the row to wrap

service
ActionService

the ActionService that will handle updating the row

parentService
ActionService

the ActionService that will handle updating the parent row