Questions tagged [nanostores]
6 questions
2
votes
0 answers
nanostores/router can't and catch url path containing a '.' in the final sub-path
I am working on a SPA using a Svelte front-end and using the router, nanostores/router package.
In the Routes.svelte file:
{#if !$page.router}
{:else if ...
However, if the url final sub-path contains a full-stop '.' e.g.…

Kevin Chaplin
- 31
- 3
2
votes
1 answer
Astro: Access nano store hook "useStore" from a *.astro file
I've defined a nano store in src/themeStore.ts:
import { atom } from 'nanostores';
export const theme = atom('blue');
I'm trying to access the store's value in the front-matter of an *.astro file.
src/pages/samples/[id].astro:
import { useStore }…

Jonathan.Brink
- 23,757
- 20
- 73
- 115
1
vote
0 answers
Nanostore triggering an exception when used from inside onAuthStateChanged
When I'm using an atom store (from the nanostores library) from inside the onAuthStateChanged, I'm getting an error: Cannot read properties of undefined (reading '_freezeSettings'). From outside, it is working fine.
UserStore.ts file:
import…

angelcervera
- 3,699
- 1
- 40
- 68
0
votes
0 answers
Unable to update object in nanostore using setKey
I am trying to learn Astro and how to share state with it and I am having a hard time getting a function to update an object in the nanostore.
I have a store of notifications, each of which looks like this:
{
name: "Nathan Peterson",
type:…

Mossy82
- 115
- 1
- 9
0
votes
1 answer
Nanostores is not working in Astro component
Problem: So I was able to successfully add nanostores into a React test component that I created but what I want to do is be able to use nanostores in an Astro component (*.astro). I'm trying to make just a simple web app solely in Astro with no…

jayweezy
- 81
- 8
0
votes
1 answer
Nanostores in Astro is not working as expected with Vue... does not sync or hold state on page re-render
I am trying to create an online store with astro while using Vue componenents (SSR suing Netlify as an Adapter).
It's been a good learning experience and I am intentionally not using NUXT as I'd like to try out the SSR option of Astro with Vue…

Alim Bolar
- 479
- 4
- 17