Open sunfmin opened 7 years ago
After some thoughts, the paramObject needs to be pass into containers as url of the page, because we want to change the url of the search even if we only refresh one container of the whole page. that PJAX? https://github.com/defunkt/jquery-pjax
maybe I should try to implement the FilterOptions first in React in a Container, to see what do we need.
Change the URL using JS history to include the search query, and then post the event? When the containers are reloaded, the query will be included, and then the results container will have access to the query.
For example
postEvent("product_searched", paramObject)
, then refresh containers will pass the paramsObject to the FilteredProducts container, In the containers, It do the search logic and render products.