input.js 205 B

1234567891011121314
  1. function then(fn) {
  2. return async (value) => {
  3. return fn(await value);
  4. };
  5. }
  6. var result = 1
  7. |> (async (x) => await x + 1)
  8. |> then((x) => x + 1);
  9. result.then(val => {
  10. expect(val).toBe(3);
  11. });