Running customJS on init

Hi, I am able to make a callback function which gets triggered on a buttonclick like this:

export_button = Button(label="Export slope file")
export_button.js_on_event(events.ButtonClick, export_func)

This is great, however I need the js function to trigger automatically when bokeh initializes. Is that possible somehow?

A simple way to get that functionality should be available in 2.2: https://github.com/bokeh/bokeh/issues/10344

Any way to do it in 2.0? I am stuck on that version for now :confused:

Essentially what i just need to be able to do is to trigger a callback from outside bokeh (in react)… so what i wanted was to save some callback in the window object as soon as possible, which i can then trigger from a react button