Skip to content

Commit 4272c7c

Browse files
committed
TS
1 parent 7a074bf commit 4272c7c

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

esm/literals.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,6 @@ import { empty } from './utils.js';
77
/** @typedef {Node | Element | PersistentFragment} Target */
88
/** @typedef {null | undefined | string | number | boolean | Node | Element | PersistentFragment} DOMValue */
99

10-
/**
11-
* @typedef {Object} Entry
12-
* @property {number[]} path
13-
* @property {function} update
14-
* @property {string} name
15-
*/
16-
1710
/**
1811
* @param {DocumentFragment} f content retrieved from the template
1912
* @param {Entry[]} e entries per each hole in the template
@@ -27,22 +20,29 @@ export const cel = (f, e, d) => ({ f, e, d });
2720
* @property {any} v the current value of the interpolation / hole
2821
* @property {function} u the callback to update the value
2922
* @property {Node} t the target comment node or element
30-
* @property {string} n the name of the attribute, if any
23+
* @property {string | null} n the attribute name, if any, or `null`
3124
*/
3225

3326
/**
3427
* @param {any} v the current value of the interpolation / hole
3528
* @param {function} u the callback to update the value
3629
* @param {Node} t the target comment node or element
37-
* @param {string?} n the attribute name, if any, or `null`
30+
* @param {string | null} n the attribute name, if any, or `null`
3831
* @returns {Detail}
3932
*/
4033
export const detail = (v, u, t, n) => ({ v, u, t, n });
4134

35+
/**
36+
* @typedef {Object} Entry
37+
* @property {number[]} p the path to retrieve the node
38+
* @property {function} u the update function
39+
* @property {string | null} n the attribute name, if any, or `null`
40+
*/
41+
4242
/**
4343
* @param {number[]} p the path to retrieve the node
4444
* @param {function} u the update function
45-
* @param {string?} n the attribute name, if any, or `null`
45+
* @param {string | null} n the attribute name, if any, or `null`
4646
* @returns {Entry}
4747
*/
4848
export const entry = (p, u, n) => ({ p, u, n });

esm/render/reactive.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ export default effect => {
3131
}
3232
if (typeof what === 'function') {
3333
const wr = new WeakRef(where);
34-
dispose = effect(() => { render(wr.deref(), what().valueOf(), false) });
34+
dispose = effect(() => { render(wr.deref(), what(), false) });
3535
effects.set(where, dispose);
3636
return create(dispose, onGC, { return: where });
3737
}
3838
else {
3939
effects.delete(where);
40-
return render(where, what.valueOf(), false);
40+
return render(where, what, false);
4141
}
4242
};
4343
};

0 commit comments

Comments
 (0)