~/talk

Are promises our only choice?

Talkat Conf42 JavaScript 2022 · on Thursday, 2022-11-17· [javascript, functional-programming]
links:none on file
slides:none on file

Promises have eager evaluation, errors type as any, and let you omit catches, so this demo switches to fpts Task and TaskEither to get lazy evaluation and explicit error types, shows composing tasks with pipe to preserve referential transparency, sequences tasks so a failing step short‑circuits remaining work, uses remote-data to represent initial / pending / failure / success states for UI, and demonstrates Futures that run lazily and return a cancel function so long‑running requests can be unsubscribed.

AI-written summary · about

  1. 0:00Async operations intro
  2. 5:17Promise limitations
  3. 6:00What is functional programming
  4. 8:32Functional alternatives
  5. 9:39Lazy evaluation with tasks
  6. 13:42Composable functions
  7. 18:06Referential transparency
  8. 20:34Short-circuiting with tasks
  9. 24:28Error handling with Either
  10. 35:14Async states with RemoteData
  11. 39:59Cancellable futures
  12. 47:15Conclusion and key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.