Skip to content

Make formattable work with promises-package #132

@simdadim

Description

@simdadim

Formattable-rendering is not working in shiny when using promises.

library(shiny)
library(formattable)
library(promises)
library(future)

ui <- fluidPage(
  formattableOutput("table")
)

server <- function(input, output, session) {
  output$table <- renderFormattable({
    future({mtcars}) %...>% formattable()
  })
}

shinyApp(ui, server)

This minimal example gives the error:
no applicable method for 'as.htmlwidget' applied to an object of class "promise"

which seems to missing handling of how to convert a future-formattable into a html-widget in the renderFormattable-function.

https://rstudio.github.io/promises/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions