-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomposition.js
More file actions
47 lines (36 loc) · 813 Bytes
/
composition.js
File metadata and controls
47 lines (36 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
const ramda = require('ramda');
const curry = ramda.curry;
const compose = ramda.compose;
const pipe = ramda.pipe;
// function fazerMassa(ingredientes) => massaBolo
// function assarBolo(massaBolo) => bolo
// function fazerBolo(ingredientes) => bolo
// assarBolo(fazerMassa(ingredientes))
function somar(a, b) {
return a + b;
}
function multiplicar(a, b) {
return a * b;
}
const somarC = curry(somar);
const multiplicarC = curry(multiplicar);
const adicionar1 = somarC(1);
const dobro = multiplicarC(2);
const dobroMais1 = compose(
adicionar1,
dobro
);
const pipeExemplo = pipe(
adicionar1,
dobro
);
console.log(dobroMais1(2));
console.log(pipeExemplo(2));
// function formatarJson(json) {
// return {
// json
// }
// }
// function postRequest(json) {
// await axios.get('')
// }