Simplify output API

This commit is contained in:
Joe Cheng
2012-06-29 15:53:10 -07:00
parent c3268d0362
commit 4b1123c4e4
6 changed files with 77 additions and 59 deletions

View File

@@ -1,15 +1,16 @@
library(digest)
text <- observable(function() {
text <- reactive(function() {
str <- input$input1
if (input$addnewline)
str <- paste(str, "\n", sep='')
return(str)
})
define.output('md5_hash', function() {
digest(text$get.value(), algo='md5', serialize=F)
output$md5_hash <- reactive(function() {
digest(text(), algo='md5', serialize=F)
})
output$sha1_hash <- reactive(function() {
digest(text(), algo='sha1', serialize=F)
})
define.output('sha1_hash', function() {
digest(text$get.value(), algo='sha1', serialize=F)
})