These are chat archives for ramda/ramda

24th
Dec 2018
Nguyễn Công Uyên
@3dtracman_twitter
Dec 24 2018 16:04
hi, how could I use Ramda for fuzzy search for this code below?
export const search = (fields = []) => (data = []) => (searchTerms = []) =>
    data.filter(row =>
        searchTerms.every(term =>
            fields.some(field =>
                `${row[field] || ''}`.toLowerCase().indexOf(term.toLowerCase()) > -1)));
Heliton Nordt
@hnordt
Dec 24 2018 20:07

Hello Everyone!

What's the best way to write () => push(to) in a functional way? (push accepts two args, I need to create a fn that passes only the first one and ignore the rest)

R.partial(R.unary(push), [to])

?

Raja Rao DV
@rajaraodv_twitter
Dec 24 2018 22:52
Is there a Ramda function that does this: const getIdObj = (obj) => {return {id: obj.id}}
Raja Rao DV
@rajaraodv_twitter
Dec 24 2018 23:03
and do this: const getData = (obj) => obj.data();