These are chat archives for ramda/ramda

8th
Aug 2017
Jonathan Chang
@jdkschang
Aug 08 2017 15:51
@dustinws Thanks for replying! I thought so too, but I continued to get the error message function (t){return n.apply(this,arguments)} does not have a method named …. I understand that R.__ acts as a placeholder, but when I enter in animateSlide({ left: ‘250px’ }, { left: ‘10px’ }) it produces the error mentioned above.
Jonathan Chang
@jdkschang
Aug 08 2017 16:00
the REPL using Ramda v0.24.1 for invokerN might be broken. On redirect I can see on the output
function n(r){return NaN|b(r)?n:t.apply(this,arguments)} does not have a method named “join”
as opposed to the expected output from the console.logs:
// Add a whollop of Mayonnaise
// Add a whollop of Potato Chips
// Add a whollop of Potato Ketchup
Jonathan Chang
@jdkschang
Aug 08 2017 16:06
Salad.prototype.recipe = function() {
  var instructions = R.map((ingredient) => (
    'Add a whollop of ' + ingredient, this.ingredients)
  )
  return R.join('\n', instructions)
}
this.ingredients should be separated from the function call
Salad.prototype.recipe = function() {
  var instructions = R.map((ingredient) => ( 'Add a whollop of ' + ingredient), this.ingredients)
  return R.join('\n', instructions)
}
Dustin Stiles
@dustinws
Aug 08 2017 16:16
@jdkschang This stuff is in the repl, right? Could you help me out with a link? I can't seem to find this example on the ramda site.
this is from http://ramdajs.com/docs/#constructN
and clicking on Open in REPL
Dustin Stiles
@dustinws
Aug 08 2017 16:19
@jdkschang Ohh, I see. You actually fixed this yourself when you updated your code snippet
You're right about the separation. The closing paren is just in the wrong place in the map call.
Jonathan Chang
@jdkschang
Aug 08 2017 16:21
ah yea, I was trying to show what I thought was the “correct" way to call the function
Dustin Stiles
@dustinws
Aug 08 2017 16:21
You were right!
Just removing the parens fixes it.
Jonathan Chang
@jdkschang
Aug 08 2017 16:22
so I wasn’t sure if it fixed it because the last output returns undefined
Dustin Stiles
@dustinws
Aug 08 2017 16:23
That's the return value of the console.log at the end :)
That's without the console.log, you can see all of the strings are joined.
Looks like the example needs to be fixed. Wanna submit an issue @jdkschang?
Jonathan Chang
@jdkschang
Aug 08 2017 16:25
oh hahahaha, makes sense. sounds good @dustinws
Dustin Stiles
@dustinws
Aug 08 2017 16:25
Also, pro-tip, clicking share in the repl gives you short link so you can avoid the long ones.
It's on the left side next to reset
Jonathan Chang
@jdkschang
Aug 08 2017 16:26
the pro-est of pro-tips
+1
YasaaMoin
@Yasaa
Aug 08 2017 16:44
heard about this gitter room from a freecodecamp gitter room
They praised you guys for the projects you build.What is this room about?
Jonathan Chang
@jdkschang
Aug 08 2017 17:07
submitted a pull request for the constructN repl issue: ramda/ramda#2250
@Yasaa Can’t speak for everyone here, but I’ve found it helpful to look at the problems people tackle as well as how they tackle it and come up with a solution. From my experience everyone is willing to lend a helping hand. Ask away!
YasaaMoin
@Yasaa
Aug 08 2017 17:45
" to look at the problems people tackle as well as how they tackle it and come up with a solution" well now I really am looking forward to learning a lot here.
Lets try it then @jdkschang .....
For a chat app I'm using socket.io version 0.9 and I noticed that in version 1.0 a few methods that I used from 0.9 were deprecated like: io.set is gone,and log level event is deprecated.
Will that impact my project in any way? Because I'm already running into issues here.
Kurt Milam
@kurtmilam
Aug 08 2017 17:49
@Yasaa most discussion in this room is related to functional programming in JavaScript, generally, and to using the Ramda library, specifically.
I think it's probably OK to ask off-topic questions here, but you're probably less likely to get answers to them than you would to more on-topic questions.
Aadi Deshpande
@cilquirm
Aug 08 2017 18:43
Hi, what's the right way to inject a value into a stream of functions
i.e. i have a R.pipe that starts by constructing a new object and assoc'ing additional values , but the qualifiers for adding those properties are not in the object, they're external
Matt Grande
@mattgrande
Aug 08 2017 18:48
Include your options in the pipe call:
R.pipe(
    o => doSomething(o.object, o.options),
)({object: myObjectWithTheValues, options: theseAreTheOptions})
Matthew Willhite
@miwillhite
Aug 08 2017 18:49
Also checkout https://github.com/ramda/ramda-fantasy/blob/master/docs/Reader.md (though I think a different Reader implementation would be a better investment, seems like ramda-fantasy is slowing?)
Dustin Stiles
@dustinws
Aug 08 2017 19:45
@miwillhite I've got something brewing here. If anyone is looking for an investment, I'd love some help on that project.
Heads up, docs are still a WIP, and the type signatures for instance methods were written before I discovered the awesome ~> squiggle convention.
I suppose it's on the other end of the spectrum. Pretty new and really no community as of yet. But it is FL compliant.
Matthew Willhite
@miwillhite
Aug 08 2017 20:01
very cool @dustinws I’ll take a look!
Aadi Deshpande
@cilquirm
Aug 08 2017 20:19
hi @mattgrande thanks. i was trying to do it in a pointfree style. I was already doing
const someVal = 100;
R.pipe(
  constructDataObject,
  (obj) => R.when( R.gt(50), R.always('fixed'), someVal )
  ...
)
i.e. ignoring the piped in value. i apologize if i wasn't clear on what my intention was
I just realized I could do
R.pipe(
  constructDataObject,
  R.always( R.when( R.gt(50), R.always('fixed'), someVal ) ),
...
)(initialObject);