For context, in the article How to create custom input bindings, it states under Additional methods:
In addition to the previously discussed methods, several other JavaScript methods can be added to your input binding object, notably; getId, getState, getRatePolicy, receiveMessage and unsubscribe. These are discussed in the various references provided and are not further discussed here.
The custom input bindings example from the Shiny gallery has this method - see below (truncated for brevity):
var urlInputBinding = new Shiny.InputBinding();
$.extend(urlInputBinding, {
...
// This returns a full description of the input state.
// Note that some inputs may be too complex for a full description of the
// state to be feasible.
getState: function(el) {
return {
label: $(el).parent().find('label[for="' + $escape(el.id) + '"]').text(),
value: el.value
};
}
...
}
I did a thorough (I think) search of the Shiny codebase and only saw getState when the input is being created, so I'm thinking now it might just be for testing/debugging purposes and not required for bookmarking state?