feat: implement loaders
This commit is contained in:
11
src/lib/loaders/LoaderYear.ts
Normal file
11
src/lib/loaders/LoaderYear.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { DB } from '$lib/integrations/db';
|
||||
|
||||
export const LoaderYear = (year?: number) => {
|
||||
year = year ?? new Date().getFullYear();
|
||||
|
||||
return () => DB.getYear(year);
|
||||
};
|
||||
|
||||
export const LoaderYears = () => {
|
||||
return () => DB.getYears();
|
||||
};
|
||||
Reference in New Issue
Block a user