HackerTrans
トップ新着トレンドコメント過去質問紹介求人

sethcalebweeks

no profile record

コメント

sethcalebweeks
·9 か月前·議論
I love the idea! The creativity of (ab)using JavaScript type coersion is really neat. I did something similar using proxies to create a chainable API.

https://dev.to/sethcalebweeks/fluent-api-for-piping-standalo...

  const shuffle = (arr) => arr.sort(() => Math.random() - 0.5);
  const zipWith = (a, b, fn) => a.slice(0, Math.min(a.length, b.length)).map((x, i) => fn(x, b[i]));
  const log = (arr) => {
    console.log(arr);
    return arr;
  };

  const chain = chainWith({shuffle, zipWith, log});

  chain([1, 2, 3, 4, 5, 6, 7, 8, 9])
    .map((i) => i + 10)
    .log() // [ 11, 12, 13, 14, 15, 16, 17, 18, 19 ]
    .shuffle()
    .log() // e.g. [ 16, 15, 11, 19, 12, 13, 18, 14, 17 ]
    .zipWith(["a", "b", "c", "d", "e"], (a, b) => a + b)
    .log() // e.g. [ '16a', '15b', '11c', '19d', '12e' ]
    [0]; // e.g. '16a'
sethcalebweeks
·昨年·議論
Location: Syracuse, NY

Remote: Yes (preferred)

Willing to relocate: No

Technologies: React, Vue, Angular, Svelte, Solid, TypeScript, Elixir, OCaml, C#, Blazor, Clojure

Résumé/CV: Senior Software Architect and Engineer with a master's in Computer Engineering and Mechanical Engineering. Founding engineer of a conversational banking startup.

Email: [email protected]