Hooks doctype_js

Dear All,

I am trying to understand in hooks if it is possible in extending doctype_js to call the main js method as it is being done in python.

in the python example found in the tutorial
from frappe.desk.doctype.todo.todo import ToDo

class CustomToDo(ToDo):
    def on_update(self):
        self.my_custom_code()
        super(ToDo, self).on_update()

    def my_custom_code(self):
        pass

As i see, super(ToDo, self).on_update() will call the original method .

and on the same tutorial the js example
frappe.ui.form.on(‘Todo’, {
refresh: function(frm) {
frm.trigger(‘my_custom_code’);
},
my_custom_code: function(frm){
console.log(frm.doc.name)
}
});

and the hint is telling

The events/functions defined in app/public/todo.js will override those in the standard form script of ToDo doctype.

So, how to call the original method after finishing my custom method.

Many thanks