This repo contains code snippets and a demo for my workshop on Functional Programming with Ramda given at DeveloperWeek 2018. You can find the presentation slides here. You can find watch the presentation here.
There are aspects of functional programming that can be easily leveraged in your current JavaScript codebase to help you write cleaner, more readable, and more maintainable code. In particular, function composition allows you to chain together multiple functions to make sophisticated systems out of simple parts. Ramda is a JavaScript utility library that can help you to write clean, concise and functional code. It makes function composition simple.
The code from my presentation can be run in your terminal with Node.js (make sure you are using Node 8 or higher).
First, clone the repo and install the node modules:
$ git clone https://github.com/leggechr/functional-programming-with-ramda.git
$ cd functional-programming-with-ramda
$ npm install
To experiment with the code snippets you can start a Node instance:
$ node
Then in the node shell, load in the code snippet you want:
> .load CodeSnippets/<file-name.js>
At this point you can call any of the defined functions and experiment with their behaviour.
To run the code from the Tweet graph demo:
$ node tweetAnalyzer.js
These are some resources I found helpful when learning about functional programming and Ramda:
- Mostly Adequate Guide to Functional Programming
- Ramda homepage
- Ramda documentation
- What Ramda function should I use?
I work at ZenHub, a collaboration tool that displays natively in GitHub. You can download the extension at ZenHub.com.