These are chat archives for ramda/ramda
R.identity. But is it legit to use it like
const f = R.partial(R.identity, )or should I go with the default arrow style version
const f = () => 1? Any thoughts on this?
axios.get('/items/1'); axios.get('/items/1'); axios.get('/items/2'); axios.get('/items/1'); axios.get('/items/1'); // exec axios.get('/items/2'); // exec axios.get('/items/3'); axios.get('/items/3'); axios.get('/items/3'); // exec
I understand. It cannot be the first response, as it's client side, and I try to cancel out requests. It's for an scrolling-list, where pages are being fetched by
n items a time, while the api is triggered for each item :confounded:
So, page asks for item 1, 2, 3, 4, 5, .... While the api says, okay, here you have items 1-50, items 50-100, etc.
Based on the page offset, I can now compute the page number, (item 45 === page 0, while 95 === page 1), so we should debounce the request based on the page number. Allowing multiple pages at to be requested, but only a single requests per page.
But, not really relevant for Ramda. I was just hoping that I could fix it with R.memoizeWith.
I did find a package that can assist me though: https://www.npmjs.com/package/memoizee