UNPKG

@signaldb/core

Version:

SignalDB is a client-side database that provides a simple MongoDB-like interface to the data with first-class typescript support to achieve an optimistic UI. Data persistence can be achieved by using storage providers that store the data through a JSON in

11 lines (10 loc) 269 B
function uniqueBy(array, fn) { const set = /* @__PURE__ */ new Set(); return array.filter((element) => { const value = typeof fn === "function" ? fn(element) : element[fn]; return !set.has(value) && set.add(value); }); } export { uniqueBy as default };