You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to implement a select that allows the user to filter the cards by location. The filter needs to be applied to both the table and the cards view.
I am thinking about introducing state to the application, so that the Filter component can pass the selected location to the Resources and TableView components. Is this the right approach @princiya@sunithapatel?
Sounds right to me!
I also wonder if you should consider having another function to return the resources (which right now is in json but could come from a call to an API instead) and this function could take the filter as a parameter. Then the Resources and TableView components could use that function to display the data instead of using the json directly.
Hope that made sense!
I also wonder if you should consider having another function to return the resources (which right now is in json but could come from a call to an API instead)
this can be an issue by itself, when someone wants to extend the current scope to include data coming from both json and other API. the PR corresponding to this issue can only look into having state management.
Activity
sunithapatel commentedon Oct 15, 2021
Sounds right to me!
I also wonder if you should consider having another function to return the resources (which right now is in json but could come from a call to an API instead) and this function could take the filter as a parameter. Then the Resources and TableView components could use that function to display the data instead of using the json directly.
Hope that made sense!
princiya commentedon Oct 15, 2021
@RossellaFer regarding:
yes, introduce state into the application 👍
this can be an issue by itself, when someone wants to extend the current scope to include data coming from both json and other API. the PR corresponding to this issue can only look into having state management.
let me know if you have other questions.