You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some issues we currently have with the Shiny interface in our Typescript code:
Some function types end up being circular if you Cmd-click on them, like shinyUnbindAll.
Some of the methods on the Shiny object appear only after initialization, like setInputValue, bindAll, user, and so some authors might wait for those methods to be available, which is weird.
Change Shiny from an interface to a class, and make sure it has all methods from the beginning.
Add an init() method to that class.
If some of the methods are called before init(), then throw an error, with information on how to fix the problem.
Add initPromise() method, which returns a promise that resolves at the end of init(). Then code that needs to wait for Shiny to be ready can just wait for that.
Add an onInit() method, which lets you register a callback to be invoked when the initPromise() resolves.
The text was updated successfully, but these errors were encountered:
Some issues we currently have with the
Shiny
interface in our Typescript code:shinyUnbindAll
.Shiny
object appear only after initialization, likesetInputValue
,bindAll
,user
, and so some authors might wait for those methods to be available, which is weird.shiny/srcts/src/shiny/initedMethods.ts
Lines 11 to 22 in e2b7f91
Shiny
interface and aFullShinyDef
type.window.Shiny
as an empty object, but we say that it is aShiny
object.shiny/srcts/src/window/libraries.ts
Lines 3 to 10 in e2b7f91
Proposed solution (with help from @schloerke):
Shiny
from an interface to a class, and make sure it has all methods from the beginning.init()
method to that class.init()
, then throw an error, with information on how to fix the problem.initPromise()
method, which returns a promise that resolves at the end ofinit()
. Then code that needs to wait for Shiny to be ready can just wait for that.onInit()
method, which lets you register a callback to be invoked when theinitPromise()
resolves.The text was updated successfully, but these errors were encountered: