jacobgoodwin
Possible to map of `useSubmissions` result?
I was just playing with solid-router, and was curious if there was a way to map over the results of
useSubmissions
outside of a rendered <For>
component.
In the linked code: https://github.com/JacobSNGoodwin/scavenge-solid/blob/main/src/components/HuntItemsList.tsx#L43, I was trying to basically create a list of items where I optimistically filtered out any items being deleted and optimistically added any being added, while also sorting them.
I was able to get the ids of submissions being deleted in a good old fashioned for
loop, but we cannot map over the Proxied array (which may be fine and desirable).
So this had me wondering if anyone has opinions on the best way to handle this sort of situation. I'm probably coming from the react world and not doing this right.5 replies
Is there any approach to invalidate the back/forward browser cache in solid-router (v 0.12.x)?
I previously asked this question in github discussions before realizing this more-active Discord existed: https://github.com/solidjs/solid-router/discussions/384. I thought maybe somebody here might have run into this issue in recent versions of solid-router in combination with solid-start.
Repeated here:
I'm working on page which requires an authorized user to manage a list of data. When the user logs out, I redirect them to a login page.
However, if I press the back button, the browser back/forward cache takes over, and displays the last page (see point 4 in the cache documentation: https://github.com/solidjs/solid-router/blob/main/src/data/cache.ts#L16). As far as I can tell from the code, this cache lasts 180000 ms.
I would prefer that the user is not able to see the content of the page which requires an authorized user. It's not the end of the world, as taking any future action on the authorized data would eventually land them back at a login page (check the request for a user and redirect). But I still don't like the idea of showing that cached data.
Is there any mechanism for accomplishing this? Maybe via some client side code and action?
This is an example of a layout for a page using solid-start's FileRouter. I've tried playing around with the load function, but am struggling to figure this out.
https://github.com/JacobSNGoodwin/scavenge-solid/blob/errors-loging/src/routes/manage.tsx
3 replies