Skip to content

Commit

Permalink
use live module bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
mrm007 committed Feb 20, 2024
1 parent c443e0d commit 4eea27b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
5 changes: 5 additions & 0 deletions cypress/projects/typescript/entry.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { counter, increment } from './state.mjs';

export default counter;

increment();
3 changes: 0 additions & 3 deletions cypress/projects/typescript/entry.ts

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/projects/typescript/playroom.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
entry: './entry.ts',
entry: './entry.mjs',
components: './components.ts',
snippets: './snippets.ts',
outputPath: './dist',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
/* eslint-disable no-console */

declare global {
interface Window {
counter: number;
}
}

window.counter = 0;
export let counter = 0;

export function increment() {
window.counter++;
window.counter = ++counter;

console.log('incremented', window.counter);
}

0 comments on commit 4eea27b

Please sign in to comment.