The TechOps Chatbot backend is a NodeJS
API written in TypeScript
, served with ExpressJS
, secured with Passport
through a secret bearer token and provisioned on AWS using Terraform. The users feedback is stored in a DynamoDB database on AWS using the aws-sdk
and dynamodb-data-mapper
.
https://www.youtube.com/watch?v=ecIWPzGEbFc blah Uncle Bob Martin conference about the Future of programming, can reduce the whole conference in one word "discipline" FP paradigm is even older than others mainstream like OOP. It's taking a rise lately given most of the current languages/ecosystems can eventually get an approximate result, yet the time and effort to build and refactor could be very different.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export {} | |
// A monoid is a binary associative operation with an identity | |
// Laws | |
// 1 - Associativity: (x <> y) <> z = x <> (y <> z) | |
// 2 - Left identity: mempty <> x = x | |
// 3 - Right identity: x <> mempty = x | |
type Monoid<A = any> = { | |
mempty: A, |
Async and await let us handle asynchronous code easily, it's somehow similar to generators, pausing the execution whenever the await
is prefixed:
// To be able to wait for a call we need to mark a function as async
async function getTemperature () {
// We wait until the getWeather function returns the value
const weather = await getWeather(....);
The call
and apply
functions are similar, they expect a the contex (this) and the parameter to call the function, the only difference is that apply
accepts the function parameters in an array.
const calculate = function(x, y) {
return this.operation(x, y);
}
const multiply = {
NewerOlder