Description Usage Arguments Value Examples
Merge two handler objects or add a handler in a handlers_list or dispatcher objects.
1 2 | ## S3 method for class 'handler'
e1 + e2
|
e1 |
A handler, handler_list or dispatcher object. |
e2 |
A handler or handlers_list object. |
Retun a handlers_list
object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | library(eventr)
library(magrittr)
birth_handler <- handler(type = 'BIRTH', FUN = function(obj, event){
obj$birth_date <- get_body_attr(event, 'birth_date')
return(obj)
})
measurement_handler <- handler(type = 'MEASUREMENT', FUN = function(obj, event){
obj$weight <- get_body_attr(event, 'weight')
obj$height <- get_body_attr(event, 'height')
return(obj)
})
death_handler <- handler(type = 'DEATH', FUN = function(obj, event){
obj$death_date <- get_body_attr(event, 'death_date')
return(obj)
})
handlers <- birth_handler +
measurement_handler +
death_handler
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.