Skip to content

Commit

Permalink
v1.3.17
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishiv committed Oct 17, 2024
1 parent 271256f commit 6db1d59
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "alfama",
"version": "1.3.16",
"version": "1.3.17",
"author": "Abhishiv Saxena<abhishiv@gmail.com>",
"license": "MIT",
"description": "Fine-grained reactive library with no compiler, no magic, and no virtual DOM",
Expand Down
2 changes: 1 addition & 1 deletion src/core/state/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const createSignal = <T = any>(val: T): Signal<T> => {
};

const sig = [get, set] as unknown as Signal<T>;
sig.id = "signal|" + SIGNAL_COUNTER;
sig.id = SIGNAL_COUNTER;
sig.type = Constants.SIGNAL;
sig.v = val;
sig.w = new Set<Wire>();
Expand Down
4 changes: 2 additions & 2 deletions src/core/state/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type SignalSetter<T> = (newValue: T) => void;
export type SignalAPI<T = any> = [SignalGetter<T>, SignalSetter<T>];

export type Signal<T = unknown> = SignalAPI & {
id: string;
id: number;
/** Wires subscribed to this signal */
w: Set<Wire<any>>;
/** To check "if x is a signal" */
Expand Down Expand Up @@ -78,7 +78,7 @@ export type StoreChange = {
type WireState = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;

export type Wire<T = unknown> = {
id: string;
id: number;
type: typeof Constants.WIRE;

fn: WireFunction<T> | StoreCursor;
Expand Down
2 changes: 1 addition & 1 deletion src/core/state/wire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const S_NEEDS_RUN = 0b001 as const;
export const createWire: WireFactory = (arg: WireFunction): Wire => {
WIRE_COUNTER++;
const wire: Wire = Object.assign(() => {}, {
id: "wire|" + WIRE_COUNTER,
id: WIRE_COUNTER,
type: Constants.WIRE,
fn: arg,
sigs: new Set(),
Expand Down
4 changes: 0 additions & 4 deletions src/dom/traverser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ export const reifyTree = (
.filter((el) => el.dom)
.map((el: TreeStep) => el.dom as Node)
.flat();
if ((step as ComponentTreeStep).mount) {
//console.log("s", step);
}
// this enables support for portals
(
(step as ComponentTreeStep).mount || (dom as unknown as Element)
).append(...kids);
Expand Down

0 comments on commit 6db1d59

Please sign in to comment.