summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/astro-nanostores/src/components/AdminsPreact.jsx12
-rw-r--r--examples/astro-nanostores/src/components/AdminsReact.jsx14
-rw-r--r--examples/astro-nanostores/src/store/admins.js12
-rw-r--r--examples/astro-nanostores/src/store/counter.js16
-rw-r--r--examples/astro-nanostores/src/store/users.js21
5 files changed, 34 insertions, 41 deletions
diff --git a/examples/astro-nanostores/src/components/AdminsPreact.jsx b/examples/astro-nanostores/src/components/AdminsPreact.jsx
index 6c4a126ea..93fecd878 100644
--- a/examples/astro-nanostores/src/components/AdminsPreact.jsx
+++ b/examples/astro-nanostores/src/components/AdminsPreact.jsx
@@ -1,7 +1,7 @@
import { h, Fragment } from 'preact';
-import { useStore } from 'nanostores/preact'
+import { useStore } from 'nanostores/preact';
-import { admins } from '../store/admins.js'
+import { admins } from '../store/admins.js';
import { counter, increaseCounter, decreaseCounter } from '../store/counter.js';
const AdminsPreact = () => {
@@ -12,7 +12,9 @@ const AdminsPreact = () => {
<>
<h1>Preact</h1>
<ul>
- {list.map(user => <li key={user.name}>{JSON.stringify(user, null, 2)}</li>)}
+ {list.map((user) => (
+ <li key={user.name}>{JSON.stringify(user, null, 2)}</li>
+ ))}
</ul>
<div>
<h3>Counter</h3>
@@ -22,6 +24,6 @@ const AdminsPreact = () => {
</div>
</>
);
-}
+};
-export default AdminsPreact \ No newline at end of file
+export default AdminsPreact;
diff --git a/examples/astro-nanostores/src/components/AdminsReact.jsx b/examples/astro-nanostores/src/components/AdminsReact.jsx
index 4feb8c0fd..a03df1f47 100644
--- a/examples/astro-nanostores/src/components/AdminsReact.jsx
+++ b/examples/astro-nanostores/src/components/AdminsReact.jsx
@@ -1,7 +1,7 @@
-import React from 'react'
-import { useStore } from 'nanostores/react'
+import React from 'react';
+import { useStore } from 'nanostores/react';
-import { admins } from '../store/admins.js'
+import { admins } from '../store/admins.js';
import { counter, increaseCounter, decreaseCounter } from '../store/counter.js';
const AdminsReact = () => {
@@ -11,7 +11,9 @@ const AdminsReact = () => {
<>
<h1>React</h1>
<ul>
- {list.map(user => <li key={user.name}>{JSON.stringify(user, null, 2)}</li>)}
+ {list.map((user) => (
+ <li key={user.name}>{JSON.stringify(user, null, 2)}</li>
+ ))}
</ul>
<div>
<h3>Counter</h3>
@@ -22,6 +24,6 @@ const AdminsReact = () => {
<br />
</>
);
-}
+};
-export default AdminsReact; \ No newline at end of file
+export default AdminsReact;
diff --git a/examples/astro-nanostores/src/store/admins.js b/examples/astro-nanostores/src/store/admins.js
index 6a0846dfe..91215470b 100644
--- a/examples/astro-nanostores/src/store/admins.js
+++ b/examples/astro-nanostores/src/store/admins.js
@@ -1,11 +1,7 @@
-import { createDerived } from 'nanostores'
+import { createDerived } from 'nanostores';
-import { users } from './users.js'
+import { users } from './users.js';
-const admins = createDerived(users, list =>
- list.filter(user => user.isAdmin)
-)
+const admins = createDerived(users, (list) => list.filter((user) => user.isAdmin));
-export {
- admins
-} \ No newline at end of file
+export { admins };
diff --git a/examples/astro-nanostores/src/store/counter.js b/examples/astro-nanostores/src/store/counter.js
index 90cecd560..a57d8e2c3 100644
--- a/examples/astro-nanostores/src/store/counter.js
+++ b/examples/astro-nanostores/src/store/counter.js
@@ -1,19 +1,15 @@
-import { createStore, getValue } from 'nanostores'
+import { createStore, getValue } from 'nanostores';
const counter = createStore(() => {
- counter.set(0)
-})
+ counter.set(0);
+});
function increaseCounter() {
- counter.set(getValue(counter) + 1)
+ counter.set(getValue(counter) + 1);
}
function decreaseCounter() {
- counter.set(getValue(counter) - 1)
+ counter.set(getValue(counter) - 1);
}
-export {
- counter,
- increaseCounter,
- decreaseCounter
-} \ No newline at end of file
+export { counter, increaseCounter, decreaseCounter };
diff --git a/examples/astro-nanostores/src/store/users.js b/examples/astro-nanostores/src/store/users.js
index af517e7ad..719f75cd1 100644
--- a/examples/astro-nanostores/src/store/users.js
+++ b/examples/astro-nanostores/src/store/users.js
@@ -1,30 +1,27 @@
-import { createStore, getValue } from 'nanostores'
+import { createStore, getValue } from 'nanostores';
const users = createStore(() => {
users.set([
{
name: 'Imanadmin',
age: 2,
- isAdmin: true
+ isAdmin: true,
},
{
name: 'Imnotadmin',
age: 35,
- isAdmin: false
+ isAdmin: false,
},
{
name: 'Wowsomuchadmin',
age: 3634,
- isAdmin: true
+ isAdmin: true,
},
- ])
-})
+ ]);
+});
const addUser = function addUser(user) {
- users.set([...getValue(users), user])
-}
+ users.set([...getValue(users), user]);
+};
-export {
- users,
- addUser
-} \ No newline at end of file
+export { users, addUser };