|
|
|
@ -5,8 +5,12 @@ import { applyDiff } from "./applyDiff"; |
|
|
|
|
import { batch, deepSignal, watch } from "alien-deepsignals"; |
|
|
|
|
import { signal } from "alien-signals"; |
|
|
|
|
|
|
|
|
|
const openConnections: Record<Shape, ReturnType<typeof signal>> = {}; |
|
|
|
|
|
|
|
|
|
// TODO: The code is horrible.
|
|
|
|
|
export function createSignalObjectForShape(shape: Shape, scope?: Scope) { |
|
|
|
|
if (openConnections[shape]) return openConnections[shape]; |
|
|
|
|
|
|
|
|
|
// TODO:
|
|
|
|
|
// DeepSignal has a different API to alien-signals.
|
|
|
|
|
// Therefore, we need to create a "root signal" wrapper that is
|
|
|
|
@ -66,5 +70,6 @@ export function createSignalObjectForShape(shape: Shape, scope?: Scope) { |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
openConnections[shape] = rootSignal; |
|
|
|
|
return rootSignal; |
|
|
|
|
} |
|
|
|
|