@signaldb/usignal 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @signaldb/usignal
2
+
3
+ This is the [µsignal](https://github.com/WebReflection/usignal) plugin for [SignalDB](https://github.com/maxnowack/signaldb). SignalDB is a local-first JavaScript database with real-time sync, enabling optimistic UI with signal-based reactivity across multiple frameworks.
4
+
5
+ See https://signaldb.js.org/reference/usignal/ for more information.
@@ -0,0 +1,8 @@
1
+ {
2
+ "src/index.ts": {
3
+ "file": "index.umd.js",
4
+ "name": "index",
5
+ "src": "src/index.ts",
6
+ "isEntry": true
7
+ }
8
+ }
@@ -0,0 +1,5 @@
1
+ declare const usignalReactivityAdapter: import("@signaldb/core").ReactivityAdapter<{
2
+ depend: () => void;
3
+ notify: () => void;
4
+ }>;
5
+ export default usignalReactivityAdapter;
package/dist/index.mjs ADDED
@@ -0,0 +1,21 @@
1
+ import { signal as t } from "usignal";
2
+ import { createReactivityAdapter as i } from "@signaldb/core";
3
+ const r = i({
4
+ create: () => {
5
+ const e = t(0);
6
+ return {
7
+ depend: () => {
8
+ e.value;
9
+ },
10
+ notify: () => {
11
+ e.value = e.peek() + 1;
12
+ }
13
+ };
14
+ },
15
+ isInScope: void 0,
16
+ onDispose: void 0
17
+ });
18
+ export {
19
+ r as default
20
+ };
21
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { signal } from 'usignal';\nimport { createReactivityAdapter } from '@signaldb/core';\nconst usignalReactivityAdapter = createReactivityAdapter({\n create: () => {\n const dep = signal(0);\n return {\n depend: () => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n dep.value;\n },\n notify: () => {\n dep.value = dep.peek() + 1;\n },\n };\n },\n isInScope: undefined,\n onDispose: undefined,\n});\nexport default usignalReactivityAdapter;\n"],"names":["usignalReactivityAdapter","createReactivityAdapter","dep","signal"],"mappings":";;AAEA,MAAMA,IAA2BC,EAAwB;AAAA,EACrD,QAAQ,MAAM;AACJ,UAAAC,IAAMC,EAAO,CAAC;AACb,WAAA;AAAA,MACH,QAAQ,MAAM;AAEN,QAAAD,EAAA;AAAA,MACR;AAAA,MACA,QAAQ,MAAM;AACN,QAAAA,EAAA,QAAQA,EAAI,KAAS,IAAA;AAAA,MAAA;AAAA,IAEjC;AAAA,EACJ;AAAA,EACA,WAAW;AAAA,EACX,WAAW;AACf,CAAC;"}
@@ -0,0 +1,2 @@
1
+ (function(e,i){typeof exports=="object"&&typeof module<"u"?module.exports=i(require("usignal"),require("@signaldb/core")):typeof define=="function"&&define.amd?define(["usignal","@signaldb/core"],i):(e=typeof globalThis<"u"?globalThis:e||self,e.SignalDB=i(e.usignal,e.core))})(this,function(e,i){"use strict";return i.createReactivityAdapter({create:()=>{const n=e.signal(0);return{depend:()=>{n.value},notify:()=>{n.value=n.peek()+1}}},isInScope:void 0,onDispose:void 0})});
2
+ //# sourceMappingURL=index.umd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { signal } from 'usignal';\nimport { createReactivityAdapter } from '@signaldb/core';\nconst usignalReactivityAdapter = createReactivityAdapter({\n create: () => {\n const dep = signal(0);\n return {\n depend: () => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n dep.value;\n },\n notify: () => {\n dep.value = dep.peek() + 1;\n },\n };\n },\n isInScope: undefined,\n onDispose: undefined,\n});\nexport default usignalReactivityAdapter;\n"],"names":["createReactivityAdapter","dep","signal"],"mappings":"4TAEiCA,EAAAA,wBAAwB,CACrD,OAAQ,IAAM,CACJ,MAAAC,EAAMC,SAAO,CAAC,EACb,MAAA,CACH,OAAQ,IAAM,CAEND,EAAA,KACR,EACA,OAAQ,IAAM,CACNA,EAAA,MAAQA,EAAI,KAAS,EAAA,CAAA,CAEjC,CACJ,EACA,UAAW,OACX,UAAW,MACf,CAAC"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@signaldb/usignal",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "scripts": {
6
+ "build": "rimraf dist && vite build"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/maxnowack/signaldb.git"
11
+ },
12
+ "homepage": "https://signaldb.js.org",
13
+ "keywords": [
14
+ "client-database",
15
+ "client",
16
+ "database",
17
+ "local-database",
18
+ "offline-first",
19
+ "optimistic-ui",
20
+ "plugin",
21
+ "reactive",
22
+ "reactivity",
23
+ "synchronization",
24
+ "typescript",
25
+ "usignal"
26
+ ],
27
+ "author": "Max Nowack <max.nowack@gmail.com>",
28
+ "license": "MIT",
29
+ "sideEffects": false,
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "import": "./dist/index.mjs",
34
+ "require": "./dist/index.umd.js",
35
+ "default": "./dist/index.umd.js"
36
+ }
37
+ },
38
+ "main": "./dist/index.umd.js",
39
+ "module": "./dist/index.mjs",
40
+ "types": "./dist/index.d.ts",
41
+ "typesVersions": {
42
+ "*": {
43
+ "*": [
44
+ "./dist/*",
45
+ "./dist/index.d.ts"
46
+ ]
47
+ }
48
+ },
49
+ "files": [
50
+ "dist"
51
+ ],
52
+ "peerDependencies": {
53
+ "@signaldb/core": "1.x",
54
+ "usignal": "0.x.x"
55
+ }
56
+ }