mbork.pl
How to create a `resource` which accepts two signals but only refetches when the second one changes?
Here is my use-case: I have a form with some settings (let's say that their combined values are the first signal) and an "apply" button (which should trigger the actual refetch, so it increments an integer signal just to update it). Now the fetcher needs the first signal to know what data to fetch, but the actual fetching should be triggered when the second signal changes.
Any ideas?
14 replies
How to label each page with a title?
This may seem a trivial thing – and maybe it is – but please bear with me (as I have very little experience with Solid yet).
I have a Solid app. It has a
routes.tsx
file which defines routes
– a nested array of RouteDefinition
. Then I have this:
Not surprisingly, the Layout
component has a Header
component, which renders a title.
Now, here is a question: what is a canonical/best/sensible way for any of the components in routes
to tell Header
in Layout
what the title of the current "screen" is? Related question: I'd also like the <title>
tag to be dynamically set depending on the current "screen" (possibly to the same value as the one in the header). How to achieve that?12 replies
Where can I find any documentation about `RouteDefinition`?
I can see (in
dist/types.d.ts
) what properties it has, but I don't know what some of them are for. Or maybe I'm looking in the wrong place? What I need is to attach a "permission name" to each route, and then before rendering the component check if the logged in user has that permission. Is RouteDefinition.info
the right place for that?96 replies