rlang
rlang copied to clipboard
API for events and hooks
- task callbacks
- hooks and events
- deferred expressions (exits)
Needs to wrap 4 actions: append, prepend, replace, get.
Appending and prepending might be handled with push_
prefixed verbs and prepend = FALSE
argument. Replacing would be dealt with poke_
verbs, and we'd have peek_
verbs to retrieve the current hooks.
Note that some (many?) don't offer a get
option.
peek_
and poke_
don't feel very "event"-y to me. I'd prefer something like on_
or when_
I think we could make append/prepend/replace an argument to a "set" function.
Note that finalisers (e.g. reg.finalizer()
) also fall into this category (if you're not already considering as part of deferred expressions)