Skip to content

Commit 1485526

Browse files
committed
feat(async): rename async event
1 parent b58a7c9 commit 1485526

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function createComponent<
100100
> & {
101101
children?: ShadowElement;
102102
onplusnewerror?: (evt: PlusnewErrorEvent) => void;
103-
onplusnewasyncevent?: (evt: PlusnewAsyncEvent) => void;
103+
onplusneweventasync?: (evt: PlusnewAsyncEvent) => void;
104104
},
105105
): T;
106106
} {

src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,21 @@ export namespace JSX {
8282
> & {
8383
children?: ShadowElement;
8484
onplusnewerror?: (evt: PlusnewErrorEvent) => void;
85-
onplusnewasyncevent?: (evt: PlusnewAsyncEvent) => void;
85+
onplusneweventasync?: (evt: PlusnewAsyncEvent) => void;
8686
};
8787
} & {
8888
[Tag in keyof SVGElementTagNameMap]: IntrinsicElementAttributes<
8989
SVGElementTagNameMap[Tag]
9090
> & {
9191
children?: ShadowElement;
9292
onplusnewerror?: (evt: PlusnewErrorEvent) => void;
93-
onplusnewasyncevent?: (evt: PlusnewAsyncEvent) => void;
93+
onplusneweventasync?: (evt: PlusnewAsyncEvent) => void;
9494
};
9595
};
9696

9797
export interface IntrinsicAttributes {
9898
onplusnewerror?: (evt: PlusnewErrorEvent) => void;
99-
onplusnewasyncevent?: (evt: PlusnewAsyncEvent) => void;
99+
onplusneweventasync?: (evt: PlusnewAsyncEvent) => void;
100100
}
101101
}
102102

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const ERROR = "plusnewerror";
2-
const ASYNC_EVENT = "plusnewasyncevent";
2+
const EVENT_ASYNC = "plusneweventasync";
33

44
export class PlusnewErrorEvent extends CustomEvent<unknown> {
55
constructor(error: unknown) {
@@ -17,7 +17,7 @@ export class PlusnewAsyncEvent extends CustomEvent<{
1717
cause: Event;
1818
}> {
1919
constructor(originalEvent: Event, promise: Promise<unknown>) {
20-
super(ASYNC_EVENT, {
20+
super(EVENT_ASYNC, {
2121
detail: { promise, cause: originalEvent },
2222
cancelable: true,
2323
bubbles: true,

test/async.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe("webcomponent", () => {
7777
return (
7878
<span
7979
className={this.#loading.value === true ? "loading" : ""}
80-
onplusnewasyncevent={async (evt) => {
80+
onplusneweventasync={async (evt) => {
8181
if (
8282
(evt.target as HTMLElement).tagName === "BUTTON" &&
8383
evt.detail.cause.type === "click"

0 commit comments

Comments
 (0)