Data transformation in Class vs Reducer (ngrx/redux)
问题 Using ngrx/redux, and following the ngrx example app as close as possible. Now I'm doing this somewhere in the application: get totalItems (): number { return sumBy(this._data.items, 'metadata.value'); } Where the _data is the raw async data from a remote server, and is part of some data of a User . Now I have some options: 1. Create a Class User constructor (public _data: UserResponse) {} And have some methods like: get name (): string { return this._data.name; } get address (): string {