Everything about Slinky -- issues, ideas for features, where it's being used, and more
@react
which isn't too bad an experience
The useEffect stuff already works, but it doesnt seem to be persisting
@peterstorm If you want to run an effect and clean it up only once (on mount and unmount), you can pass an empty array ([]) as a second argument. Taken from https://reactjs.org/docs/hooks-effect.html#tip-optimizing-performance-by-skipping-effects
for example, you can have your normal service that invokes your API, and another implementation depending on such service but handling the cache
@peterstorm this is what I would do, if you use the router, going back doesn't actually refresh the app state, hence, the cache should be live, or you could go hardcore and cache on indexeddb/localstorage, at the end, it is just sharing the same instance on the app's lifecycle
@react
object BasicTable {
case class Props[A](tableData: List[A], tableHead: List[String])
val component = FunctionalComponent[Props[A]] { props =>
Grid(className := "tableResponsive")(
table(className := "tableWrapper")(
thead(className := "tableHead")(
tr(className := "tableRow")(
)
)
)
)
}
}
But doesnt going away from a page unmount the componenet, and thus all the state? So if I have a list of 10 profiles, press a profile to see a detailed view, then the state of the profile search will be unmounted right? So router shouldn't work there, right?
That's why the same cached states should be propagated to all components depending on such data, it should work, where it wouldn't work is when you reload the page, or a new tab is opened