selfrefactor / rambda

Faster and smaller alternative to Ramda
https://selfrefactor.github.io/rambda
MIT License
1.65k stars 89 forks source link

feat: add nop method #652

Closed romgrk closed 2 years ago

romgrk commented 2 years ago

This PR adds the nop() method, which does nothing and can be used as a placeholder or default value for function types. It fulfills a similar role than R.identity does.

Admittedly, this one doesn't match any ramda methods, but rambda's goal of being an utility belt makes it the best place where to add this function. I often end up repeating const NOOP = () => {} in many points in my projects due to the absence of this function.

selfrefactor commented 2 years ago

I will have to decline it and add it to Rambdax. But this MR further shows me that it is required to differentiate from Ramda and start brand anew with other name. There is related issue for this, but no particular idea for the name, but now I am more convinced that it is needed.

I will approve the MR but it will be included in Rambdax when release is made. I will write here once this happens.

selfrefactor commented 1 year ago

Released as R.noop in Rambdax v10