Custom useConnector with hooks


I’m trying to implement a custom connector to use it over my application and refine using different features, like boundindBox and polygons.

Using the HOC approach we could achieve that with createConnector and extending the function refine, getSearchParameters and other twirks there, then we use it to consume and refine in different steps over the application/components.

With hooks I’m getting a few issues to create it in a Next application, the documentation is not very clear how to use a custom connector, not one created by algolia team.
I’m following this connector documentation and this connector hook doc.

Do you have an example where you expose an extended refine function that works with multiples getSearchParameters, refine, currentRefinements, createURL and etc, like with HOC or directions how to implement it?

At last, my ideia is pretty much the same as the docs.
Connector -> useConnector(Connector) -> in any component useConnector(props?)

Please, let me know if you need more information.