![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@nanostores/solid
Advanced tools
Solid integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores.
Solid integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores.
Install it:
pnpm add nanostores @nanostores/solid # or npm or yarn
Use it:
// store.ts
import { action, atom, computed } from 'nanostores';
export const counter = atom(0);
export const increase = action(counter, 'increase', (store) => {
counter.set(counter.get() + 1);
});
// Use computed stores to create chains of reactive computations.
export const doubled = computed(counter, current => current * 2);
import { useStore } from '@nanostores/solid';
import { counter, increase } from './store';
function Counter() {
const count = useStore(counter);
return <h1>{count()} around here ...</h1>;
}
function Controls() {
return <button onClick={increase}>one up</button>;
}
Nano Stores support SSR. Use standard strategies.
import { isServer } from 'solid-js/web';
if (isServer) {
settings.set(initialSettings);
router.open(renderingPageURL);
}
You can wait for async operations (for instance, data loading via isomorphic fetch()
) before rendering the page:
import { renderToString } from 'solid-js/web';
import { allTasks } from 'nanostores';
post.listen(() => {}); // Move store to active mode to start data loading
await allTasks();
const html = renderToString(<App />);
@nanostores/router
import { createRouter } from '@nanostores/router';
import { useStore } from '@nanostores/solid';
import { Match, Suspense, Switch, lazy } from 'solid-js';
export const routerStore = createRouter({
home: '/',
post: '/posts/:postId',
comment: '/posts/:postId/comments/:commentId',
});
const Home = lazy(() => import('./pages/Home'));
const Post = lazy(() => import('./pages/Post'));
const Comment = lazy(() => import('./pages/Comment'));
const NotFound = lazy(() => import('./pages/NotFound'));
export function Router() {
const page = useStore(routerStore);
return (
<Switch fallback={<NotFound />}>
<Match when={page().route === 'home'}>
<Home />
</Match>
<Match when={page().route === 'post'}>
<Post postId={page().params.postId} />
</Match>
<Match when={page().route === 'comment'}>
<Comment postId={page().params.postId} commentId={page().params.commentId} />
</Match>
</Switch>
);
}
MIT
FAQs
Solid integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores.
We found that @nanostores/solid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.