Skip to content

u/verdagon

In this archive from Sep 2012 to Mar 2026

9
posts
9
comments
2
media
143
score

Best way to have callbacks from a function?

Hi everyone, I'd like your opinion on the best way to have a function take in callbacks. I have a startDriving() function, but the caller would like to be able to supply callbacks so it can update the user on its progress. There are three options I've seen for making this happen, and I'd like to kno...

2 points10 comments
Open on Reddit

End of this list.

Back to top

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.