mbork.pl
mbork.pl
SSolidJS
Created by mbork.pl on 7/19/2024 in #support
What type a derived signal should be?
just () => boolean or Accessor<boolean>?
13 replies
SSolidJS
Created by mbork.pl on 7/18/2024 in #support
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
SSolidJS
Created by mbork.pl on 5/27/2024 in #support
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:
render(() => (
<Router root={Layout}>
{routes}
</Router>
), document.getElementById('app')!);
render(() => (
<Router root={Layout}>
{routes}
</Router>
), document.getElementById('app')!);
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
SSolidJS
Created by mbork.pl on 5/21/2024 in #support
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