Object(...)(...).on is not a function

i want to add some event listener on search result
i make
autocomplete({
code
}).on(‘autocomplete:selected’, function (event, suggestion, dataset) {
code
});

but i get Object(…)(…).on is not a function