More lib files, more functional

Still missing that 'attack' fn, though :(
This commit is contained in:
2023-12-06 01:21:48 +01:00
parent 42b8afdecf
commit 545f8b4366
4 changed files with 43 additions and 15 deletions

7
lib/combinators.ts Normal file
View File

@@ -0,0 +1,7 @@
export const tap = (fn) => (input) => {
fn(input);
return input;
};
export const doIf = (fn, pred) => (input) =>
pred ? fn(input) : input;