diff --git a/examples/vanilla-basic/package.json b/examples/vanilla-basic/package.json index 31694fc..a785626 100644 --- a/examples/vanilla-basic/package.json +++ b/examples/vanilla-basic/package.json @@ -13,6 +13,6 @@ "vite": "^4.4.5" }, "dependencies": { - "magic-lottery": "^1.2.3" + "magic-lottery": "^1.2.4" } } diff --git a/examples/vanilla-basic/pnpm-lock.yaml b/examples/vanilla-basic/pnpm-lock.yaml index 0810ed0..61a4007 100644 --- a/examples/vanilla-basic/pnpm-lock.yaml +++ b/examples/vanilla-basic/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: magic-lottery: - specifier: ^1.2.3 - version: 1.2.3 + specifier: ^1.2.4 + version: 1.2.4 devDependencies: typescript: @@ -255,8 +255,8 @@ packages: dev: true optional: true - /magic-lottery@1.2.3: - resolution: {integrity: sha512-Fhq/kBMhCDl5ebtD4VTOVO82nCYWYFT3m8t/1eNvkloFtLy5m6SZ1Gku8fW0Sdvnziq5NSN9vr1cHRqkUVxQkQ==} + /magic-lottery@1.2.4: + resolution: {integrity: sha512-Vjhm60QEghWiasg+YrCl87jnenUgSvmw33Gh80kbpgZOgEy6qbC+U1uHkCnHogw3yhFf9KEdOMsGTPgn3RMeLg==} dev: false /nanoid@3.3.6: diff --git a/examples/vanilla-basic/src/lottery.ts b/examples/vanilla-basic/src/lottery.ts index 055d405..632f2a6 100644 --- a/examples/vanilla-basic/src/lottery.ts +++ b/examples/vanilla-basic/src/lottery.ts @@ -1,6 +1,6 @@ import MagicLottery from "magic-lottery"; -const lottery = new MagicLottery(); +const lottery = new MagicLottery([]); export function setupCounter(element: HTMLButtonElement) { let counter = 0; diff --git a/src/index.ts b/src/index.ts index 4dbc643..61883e3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -30,7 +30,7 @@ class MagicLottery { private channelName?: string; private replacement: boolean; - constructor(entries: T[], options: Options = {}) { + constructor(entries: T[] = [], options: Options = {}) { this.entries = entries; this.shuffle = options.shuffle || this.defaultShuffle;