Skip to content

Commit a471676

Browse files
committed
♻️ Add constructor (#1845)
1 parent 2d4588c commit a471676

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib/stores/active_contest_type.svelte.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ import { type ContestTableProviders } from '$lib/utils/contest_table_provider';
1414
export class ActiveContestTypeStore {
1515
value = $state<ContestTableProviders>('abcLatest20Rounds');
1616

17+
/**
18+
* Creates an instance with the specified contest type.
19+
*
20+
* @param defaultContestType - The default contest type to initialize.
21+
* Defaults to 'abcLatest20Rounds'.
22+
*/
23+
constructor(defaultContestType: ContestTableProviders = 'abcLatest20Rounds') {
24+
this.value = defaultContestType;
25+
}
26+
1727
/**
1828
* Gets the current contest table providers.
1929
*

0 commit comments

Comments
 (0)