@nanostores/solid
Advanced tools
Comparing version 0.3.2 to 0.4.2
@@ -1,1 +0,1 @@ | ||
"use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},p=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of i(e))!S.call(t,r)&&r!==n&&a(t,r,{get:()=>e[r],enumerable:!(o=c(e,r))||o.enumerable});return t};var m=t=>p(a({},"__esModule",{value:!0}),t);var T={};l(T,{useStore:()=>f});module.exports=m(T);var s=require("solid-js/store"),u=require("solid-js");function f(t){let e=t.get(),[n,o]=g(e),r=t.subscribe(o);return(0,u.onCleanup)(()=>r()),n}function g(t){let[e,n]=(0,s.createStore)({value:t});return[()=>e.value,o=>{let r=(0,s.unwrap)(e.value);return typeof o=="function"&&(o=o(r)),n("value",(0,s.reconcile)(o)),e.value}]}0&&(module.exports={useStore}); | ||
import{createStore as s,reconcile as a,unwrap as u}from"solid-js/store";import{onCleanup as c}from"solid-js";function p(o){let t=o.get(),[r,e]=i(t),n=o.subscribe(e);return c(()=>n()),r}function i(o){let[t,r]=s({value:o});return[()=>t.value,e=>{let n=u(t.value);return typeof e=="function"&&(e=e(n)),r("value",a(e)),t.value}]}export{p as useStore}; |
{ | ||
"name": "@nanostores/solid", | ||
"version": "0.3.2", | ||
"type": "module", | ||
"version": "0.4.2", | ||
"description": "Solid integration for Nano Stores, a tiny state manager with many atomic tree-shakable stores.", | ||
@@ -8,2 +9,9 @@ "publishConfig": { | ||
}, | ||
"author": "Robert Soriano <sorianorobertc@gmail.com>", | ||
"license": "MIT", | ||
"homepage": "https://github.com/nanostores/solid#readme", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/nanostores/solid.git" | ||
}, | ||
"keywords": [ | ||
@@ -15,24 +23,17 @@ "store", | ||
], | ||
"license": "MIT", | ||
"author": "Robert Soriano <sorianorobertc@gmail.com>", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/nanostores/solid.git" | ||
"exports": { | ||
"require": "./dist/index.cjs", | ||
"import": "./dist/index.js" | ||
}, | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"homepage": "https://github.com/nanostores/solid#readme", | ||
"peerDependencies": { | ||
"nanostores": "^0.7.0", | ||
"solid-js": ">=1.4.0" | ||
"nanostores": ">=0.8.0", | ||
"solid-js": "^1.6.0" | ||
}, | ||
"scripts": {} | ||
} |
@@ -101,3 +101,3 @@ # Nano Store Solid | ||
export const Router = () => { | ||
export function Router() { | ||
const page = useStore(routerStore); | ||
@@ -118,3 +118,3 @@ | ||
); | ||
}; | ||
} | ||
``` | ||
@@ -121,0 +121,0 @@ |
7419
2018
7
20
Yes
3