Skip to content

Commit

Permalink
Update templates to use generic
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed Jan 30, 2025
1 parent a0230c8 commit 265fbff
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions v3/internal/templates/base/frontend/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ window.doGreet = () => {
});
}

Events.On('time', (time) => {
timeElement.innerText = time.data;
Events.On('time', (timeValue) => {
timeElement.innerText = timeValue.data;
});
2 changes: 1 addition & 1 deletion v3/internal/templates/lit-ts/frontend/src/my-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class MyElement extends LitElement {

constructor() {
super();
Events.On('time', (timeValue: { data: string }) => {
Events.On<string>('time', (timeValue) => {
this.time = timeValue.data;
});
}
Expand Down
2 changes: 1 addition & 1 deletion v3/internal/templates/preact-ts/frontend/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function App() {
}

useEffect(() => {
Events.On('time', (timeValue: any) => {
Events.On<string>('time', (timeValue) => {
setTime(timeValue.data);
});
}, []);
Expand Down
2 changes: 1 addition & 1 deletion v3/internal/templates/qwik-ts/frontend/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const App = component$(() => {
}

useVisibleTask$(() => {
Events.On('time', (timeValue: any) => {
Events.On<string>('time', (timeValue) => {
time.value = timeValue.data;
});
// Reload WML so it picks up the wml tags
Expand Down
2 changes: 1 addition & 1 deletion v3/internal/templates/react-swc-ts/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function App() {
}

useEffect(() => {
Events.On('time', (timeValue: any) => {
Events.On<string>('time', (timeValue) => {
setTime(timeValue.data);
});
// Reload WML so it picks up the wml tags
Expand Down
2 changes: 1 addition & 1 deletion v3/internal/templates/react-ts/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function App() {
}

useEffect(() => {
Events.On('time', (timeValue: any) => {
Events.On<string>('time', (timeValue) => {
setTime(timeValue.data);
});
// Reload WML so it picks up the wml tags
Expand Down
2 changes: 1 addition & 1 deletion v3/internal/templates/solid-ts/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function App() {
}

onMount(() => {
Events.On('time', (timeValue: any) => {
Events.On<string>('time', (timeValue) => {
setTime(timeValue.data);
});
});
Expand Down
2 changes: 1 addition & 1 deletion v3/internal/templates/svelte-ts/frontend/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
});
}
Events.On('time', (timeValue: any) => {
Events.On<string>('time', (timeValue) => {
time = timeValue.data;
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion v3/internal/templates/vanilla-ts/frontend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ greetButton.addEventListener('click', () => {
});
});

Events.On('time', (time: {data: any}) => {
Events.On<string>('time', (time) => {
timeElement.innerText = time.data;
});
4 changes: 2 additions & 2 deletions v3/internal/templates/vanilla/frontend/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ window.doGreet = () => {
});
}

Events.On('time', (time) => {
timeElement.innerText = time.data;
Events.On('time', (timeValue) => {
timeElement.innerText = timeValue.data;
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const doGreet = () => {
}
onMounted(() => {
Events.On('time', (timeValue: { data: string }) => {
Events.On<string>('time', (timeValue) => {
time.value = timeValue.data;
});
})
Expand Down

0 comments on commit 265fbff

Please sign in to comment.