Binding Shiny inputs

Method Name Utility for Custom Inputs Description
getValue(el) Value extraction Core method for extracting the current value from the input element. It must be implemented to read the appropriate property or attribute reflecting the user’s input.
subscribe(el, callback) Reactivity and event handling Sets up event listeners (e.g., on ‘change’, ‘keyup’, or ‘click’) so that any input change triggers the provided callback. This keeps Shiny aware of real-time changes in your custom component.
unsubscribe(el) Resource cleanup Removes event listeners attached in subscribe, ensuring efficient resource management and preventing memory leaks when the input is removed from the DOM.