These are chat archives for ramda/ramda

5th
Sep 2017
Scott Sauyet
@CrossEye
Sep 05 2017 00:47
... but reassigning news goes where Ramda would prefer not to go.
James Forbes
@JAForbes
Sep 05 2017 00:51
What is the type of news? it seems like its a boolean, but also an iterable/string/list.
Be great to see a few more lines of context
Isaac
@IsaacRaja_twitter
Sep 05 2017 05:28
@Yord Thanks for the pointers! ifElse, both, eqProps helped me a lot
@CrossEye @JAForbes I'll paste few more lines of context
Asaf
@asaf-romano
Sep 05 2017 05:31
eqBy(head) reads better imo
James Forbes
@JAForbes
Sep 05 2017 06:50
@IsaacRaja_twitter awesome :thumbsup:
Isaac
@IsaacRaja_twitter
Sep 05 2017 06:52
this is the context
Isaac
@IsaacRaja_twitter
Sep 05 2017 07:06
if (!_.isNull(state.search.itineraries)) {
  itineraries = state.search.itineraries.filter((itinerary) => {
    let itr = itinerary.countries && itinerary.countries.map((itt) => (itt.uuid)) || [];
    if (countries.length === 1) {
      itr = itr.length === 1 && itr[0] === countries[0];
    } else {
      itr = countries.length > 0 && _.intersection(countries, itr).length > 0 || false;
    }

    return itr;
  });
}
my solution
Syaiful Bahri
@syaiful6
Sep 05 2017 07:07
you need to wrap the code on markdown format,
surrond it with 3 backticks...
Isaac
@IsaacRaja_twitter
Sep 05 2017 07:08
formatting is messed up still
Syaiful Bahri
@syaiful6
Sep 05 2017 07:09
hmm maybe give it 4 spaces, you maybe need to edit it in your editor
Isaac
@IsaacRaja_twitter
Sep 05 2017 07:23
my solution:
if (!_.isNull(state.search.itineraries)) { itineraries = filter(countryFilterer(countries), state.search.itineraries); }
export function countryFilterer (countries) { return pipe( prop('countries'), pluck('uuid'), ifElse( () => countries.length === 1, both( pipe(length, equals(1)), pipe(head, equals(head(countries))), ), pipe(intersection(countries), length, Boolean) ) ); }
`
Iain Freestone
@iainfreestone
Sep 05 2017 09:14
Hi all, over the last few months I have been building up a list of articles and tutorials relating to Ramda while trying to learn the library better, after a colleague asked yesterday I exported all of it to a github repo. If anyone is interested its located here https://github.com/iainfreestone/ramda-links
arian‮
@arian-swydo
Sep 05 2017 09:17
thanks @iainfreestone
Iain Freestone
@iainfreestone
Sep 05 2017 09:25
no problem hope its helpful
Isaac
@IsaacRaja_twitter
Sep 05 2017 11:33
Btw, @JAForbes you're blog articles are excellent. Thanks for that!
James Forbes
@JAForbes
Sep 05 2017 12:53
Thank you so much for saying that @IsaacRaja_twitter, always nice to hear!
Keith Alexander
@kwijibo
Sep 05 2017 13:49
is there a ramda function that maps over the keys in an object ? I thought I remembered one but now can't find it
@kwijibo
Keith Alexander
@kwijibo
Sep 05 2017 13:55
Cheers
I'd already written
const mapOverKeys = f => R.pipe(
    R.toPairs,
    R.map(R.over(R.lensIndex(0), f)),
    R.fromPairs
)
which is pretty similar
Viktor Fröberg
@vikfroberg
Sep 05 2017 15:59

Sorry if this isn't the right place to ask this question. But I've found all of you so friendly so I mights as well give it a try.

I've been using Elm for a couple of side projects and I'm in love with the compiler. At work however I'm forced to use javascript (babel and flow is fine). The thing I'm struggling with is that I'm looking for a similar kind of feedback loop that you have in Elm where you save your file and you instantly get feedback from the compiler. I'm trying to run flow, eslint and babel as one script using gulp, but haven't got it working. So before I spend more time trying to get this setup running, I wanted to ask you guys is there any mature setup to achieve similar feedback loop as seen in Elm?

TLDR: Mature setup for a similar feedback loop seen in Elm, using Flow, ESLint and Babel.

Kevin Wallace
@kedashoe
Sep 05 2017 16:19
@vikfroberg i'm not aware of a tool specifically for those technologies, but i've always had a good experience with https://github.com/kimmobrunfeldt/chokidar-cli for watching files
for example at work we use make and just do chokidar -c make -- src
Viktor Fröberg
@vikfroberg
Sep 05 2017 16:56
@kedashoe thanks, will have a look at it! :)