How to call javascript function in rshiny

I have a .js file with n number of javascript functions and an .r file with observeEvent.
I would like to call a function from .js file into .r file. But I don't feel it's not working properly

filename : main.js
function dR(id){
decode = atob(id);
Shiny.onInputChange("example", reportDecode, {priority: "event"});
return this.decode

filename: server.r
observeEvent(input$example, {

js_code = paste0("dR('", input$report_id, "');")
a <- runjs(js_code)

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.