Comment

Comment by hnben

I don't like how it could result in surprises. e.g. you use it to update an array, but there are objects inside, which you accidentally modify.

I think these surprises could be reduced if you turn them into explicit parameters in the signature, e.g.

  export const updateWhere = (whereFn, updatefn, thing, recurseArray=true , recurseObjects=true)
parent hnben 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton