Instantsearch - call search from function

I have set up instantsearch with various widgets.

What I would like to be able to do if have a function that is passed aroundLatLng and then run a search using that param.

I have a couple of places where a lat/lng can be defined.


You can use the Configure widget which lets you specify raw search parameters like aroundLatLng.


I want to be able to set the param AND run the search

I was able to achieve this with the following

function getStoreResults(latLng) {
  searchStore.helper.setQueryParameter('aroundLatLng', latLng).search();

and this so it only runs if a value has been set

var searchStore = instantsearch({
  searchFunction(helper) {
    if (helper.state.aroundLatLng) {;