Skip to content

Commit 03054b5

Browse files
authored
Merge pull request #3 from codewithkyle/wip/1.1.0
📦 Release v1.1.0
2 parents f6ddc9d + 6816e07 commit 03054b5

File tree

7 files changed

+1215
-418
lines changed

7 files changed

+1215
-418
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Lazy Loader
22

3-
A lightweight (1.6kb) Web Component based lazy loading library.
3+
A lightweight (~2kb) Web Component based lazy loading library.
44

55
## Install
66

@@ -31,6 +31,8 @@ import { configure, update, mount, css } from "https://cdn.jsdelivr.net/npm/@cod
3131
configure({
3232
jsDir: "/js",
3333
cssDir: "/css",
34+
default: "lazy", // optional
35+
lazierCSS: false, // optional
3436
});
3537
3638
// Alternatively if the default settings (seen above) are okay you could simply call the update function instead
@@ -57,6 +59,8 @@ css(["example-one", "examle-two.css", "https://cdn.example.com/example-two.css",
5759
LazyLoader.configure({
5860
jsDir: "/",
5961
cssDir: "/",
62+
default: "lazy", // optional
63+
lazierCSS: false, // optional
6064
});
6165
LazyLoader.update();
6266
LazyLoader.mount("my-custom-element")
@@ -70,6 +74,8 @@ type Loading = "eager" | "lazy";
7074
interface LazyLoaderSettings {
7175
cssDir?: string;
7276
jsDir?: string;
77+
default?: Loading;
78+
lazierCSS: boolean;
7379
};
7480
7581
declare const configure: (settings?:Partial<LazyLoaderSettings>) => void;

lazy-loader.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ export type Loading = "eager" | "lazy";
33
export type LazyLoaderSettings = {
44
cssDir?: string;
55
jsDir?: string;
6+
default?: "eager" | "lazy";
7+
lazierCSS?: boolean;
68
};
79

810
declare const configure: (settings?:Partial<LazyLoaderSettings>) => void;
911
declare const update: () => void;
1012
declare const mount: (tagName:string, constructor?: CustomElementConstructor) => Promise<void>;
11-
declare const css: (files:string|string[]) => Promise<void>;
13+
declare const css: (files:string|string[]) => Promise<void>;

0 commit comments

Comments
 (0)