Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ interface Computed<T> {
get: () => T;
}

let conaKey = 0;

export class Cona extends HTMLElement {
private _op: Props;
private props: Props;
Expand Down Expand Up @@ -156,14 +158,11 @@ export class Cona extends HTMLElement {

if (s.endsWith("=")) {
if (/(p:|on|ref).*$/.test(s)) {
const key = Math.random().toString(36);

Cona._c[key] =
valueString = conaKey++;
Cona._c[valueString] =
typeof currentValue === "function"
? currentValue.bind(this)
: currentValue;

valueString = key;
} else valueString = JSON.stringify(currentValue);
} else if (Array.isArray(currentValue)) {
valueString = currentValue.join("");
Expand Down