Skip to content

Commit 4a5c49b

Browse files
Merge pull request transitive-bullshit#9 from divdavem/tansu
2 parents b9f162c + 3c1dafc commit 4a5c49b

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"author": "",
1414
"license": "ISC",
1515
"dependencies": {
16+
"@amadeus-it-group/tansu": "^2.0.0",
1617
"@angular/core": "19.0.6",
1718
"@preact/signals": "^2.0.0",
1819
"@reactively/core": "^0.0.8",

pnpm-lock.yaml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { sFramework } from "./frameworks/s";
1414
import { usignalFramework } from "./frameworks/uSignal";
1515
import { vueReactivityFramework } from "./frameworks/vueReactivity";
1616
import { svelteFramework } from "./frameworks/svelte";
17+
import { tansuFramework } from "./frameworks/tansu";
1718
// import { compostateFramework } from "./frameworks/compostate";
1819
// import { valtioFramework } from "./frameworks/valtio";
1920

@@ -24,6 +25,7 @@ export const frameworkInfo: FrameworkInfo[] = [
2425
{ framework: tc39SignalsProposalStage0, testPullCounts: true },
2526
{ framework: reactivelyFramework, testPullCounts: true },
2627
{ framework: sFramework },
28+
{ framework: tansuFramework, testPullCounts: true },
2729
{ framework: angularFramework, testPullCounts: true },
2830
{ framework: molWireFramework, testPullCounts: true },
2931
{ framework: obyFramework, testPullCounts: true },

src/frameworks/tansu.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ReactiveFramework } from "../util/reactiveFramework";
2+
import { writable, computed, batch } from "@amadeus-it-group/tansu";
3+
4+
export const tansuFramework: ReactiveFramework = {
5+
name: "@amadeus-it-group/tansu",
6+
signal: (initialValue) => {
7+
const w = writable(initialValue);
8+
return {
9+
write: w.set,
10+
read: w,
11+
};
12+
},
13+
computed: (fn) => {
14+
const c = computed(fn);
15+
return {
16+
read: c,
17+
};
18+
},
19+
effect: (fn) => computed(fn).subscribe(() => {}),
20+
withBatch: batch,
21+
withBuild: (fn) => fn(),
22+
};

0 commit comments

Comments
 (0)