You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My main use case is not wanting to JSON stringify/parse the results in large datasets to decrease the memory footprint. This particular app uses localStorage, disabled pagination, does not use $select, and has many thousands of records.
There are a number of other valuable uses cases such as using dot.notation in $select, not stringify-ing the results keeps Dates, etc.
// Return the referencial value. When using $select, you will get copies of the data because `base`// will return a selected copy. But when not using $select it returns a reference to OG data.// Beware mutability...but I am willing to take that risk in this case.constselector=(data: any,params: any, ...args: string[])=>{constbase=select(params, ...args)returnbase(data)}// Freeze the dataconstselector=(data: any,params: any, ...args: string[])=>{constbase=select(params, ...args)returnObject.freeze({ ...base(data)})}// Custom dot.notation selectionconstselector=(data: any,params: any, ...args: string[])=>{constbase=selectWithDotNotation(params, ...args)returnbase(data)}
I will try to open a PR for this when I get a chance.
The text was updated successfully, but these errors were encountered:
The
memory
package (and maybe other DB adapters?) should take aselector
option. This service already takes amatcher
andsorter
option.See:
feathers/packages/memory/src/index.ts
Line 25 in 09519fb
My main use case is not wanting to JSON stringify/parse the results in large datasets to decrease the memory footprint. This particular app uses
localStorage
, disabled pagination, does not use $select, and has many thousands of records.There are a number of other valuable uses cases such as using
dot.notation
in$select
, not stringify-ing the results keeps Dates, etc.I will try to open a PR for this when I get a chance.
The text was updated successfully, but these errors were encountered: