rlang icon indicating copy to clipboard operation
rlang copied to clipboard

API for events and hooks

Open lionel- opened this issue 6 years ago • 2 comments

  • 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.

lionel- avatar Mar 05 '18 14:03 lionel-

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.

hadley avatar Mar 05 '18 15:03 hadley

Note that finalisers (e.g. reg.finalizer()) also fall into this category (if you're not already considering as part of deferred expressions)

hadley avatar Mar 10 '18 16:03 hadley