Paradinio
How to implement a simple search-button?
We are quite new to solid, so a big sorry, if this question is repetitive, but I was not able to find a satisfying answer to our problem, yet.
There are some controlled input-fields like selects, etc. which are stored / managed in a createStore and provided via a createContext.
Those values have to be used in a fetch-function as query-params.
My initial thought was to use createResource to manage the data, and use those reactive values as a source.
There are two problems to this solution:
1. The fetcher-function is called on mount, or when it is rendered or whatever. We do not want this. The user has to initiate the fetching.
2. As soon something changes in the input fields, or let´s say, the user changes his filter settings, the data is refetched again. We do not want this. The user has to explicitly press "Show Results" again before we trigger a refetch.
I´ve built up a little example, without the store etc. as it is not part of the question.
It can be found on this playground:
https://playground.solidjs.com/anonymous/d80fb752-2732-4d65-a141-86bca13d95e8
Hope someone can help, with that!
Cheers,
Levin
6 replies