Seeks to solve (#2)
Update to the search dispatch method. (See details bellow)
This is not an elegant way to handle the search and is in need
of a refactor. However, it is functional and doesn't impose any
oddities on the programmers using it other than one minor detail.
The pattern goes as follows, no longer use the basicSearch action
instead dispatch a push to the /search route with the query param.
ex. /search?q=thing would search for thing.
The calling of the basic search now occurs based on the
LOCATION_CAHNGE action. The navBar will detect the route and grab
the query. If there is a query it will dispatch the request.
The basicSearch is still functional and will put the results in
store however the url will not stay up-to-date. If this is ok for
your use then you may use basicSearch action to do so. Otherwise,
use the above mentioned method.
The search page will also automatically search for the param in the
url when it is hit directly from url. (If the user has direct link to the page)
Seeks to solve (#2) Update to the search dispatch method. (See details bellow)
This is not an elegant way to handle the search and is in need of a refactor. However, it is functional and doesn't impose any oddities on the programmers using it other than one minor detail.
The pattern goes as follows, no longer use the basicSearch action instead dispatch a push to the /search route with the query param. ex. /search?q=thing would search for thing.
The calling of the basic search now occurs based on the LOCATION_CAHNGE action. The navBar will detect the route and grab the query. If there is a query it will dispatch the request.
The basicSearch is still functional and will put the results in store however the url will not stay up-to-date. If this is ok for your use then you may use basicSearch action to do so. Otherwise, use the above mentioned method.
The search page will also automatically search for the param in the url when it is hit directly from url. (If the user has direct link to the page)