Skip to content

Commit

Permalink
feat: setting optional properties
Browse files Browse the repository at this point in the history
  • Loading branch information
andrelmlins committed Apr 6, 2022
1 parent 805c04a commit c3072ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelte-infinite-scroll",
"version": "2.0.0",
"version": "2.0.1",
"description": "Infinite Scroll Component to Svelte",
"repository": "https://github.com/andrelmlins/svelte-infinite-scroll",
"author": "André Lins <[email protected]> (https://andrelmlins.github.io/)",
Expand Down Expand Up @@ -31,7 +31,7 @@
"rollup-plugin-terser": "^7.0.0",
"sirv-cli": "^0.4.4",
"svelte": "^3.32.0",
"svelte-dts": "^0.3.3",
"svelte-dts": "^0.3.7",
"svelte-jester": "1.1.5",
"svelte-preprocess": "^4.7.4",
"svelte-transpile-typescript": "^0.1.2",
Expand Down
14 changes: 7 additions & 7 deletions src/lib/InfiniteScroll.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
import { onMount, onDestroy, createEventDispatcher } from "svelte";
export let threshold: number = 0;
export let horizontal: boolean = false;
export let threshold: number | undefined = 0;
export let horizontal: boolean | undefined = false;
export let elementScroll: HTMLElement | null = null;
export let hasMore: boolean = true;
export let reverse: boolean = false;
export let window: boolean = false;
export let hasMore: boolean | undefined = true;
export let reverse: boolean | undefined = false;
export let window: boolean | undefined = false;
const dispatch = createEventDispatcher<{ loadMore: never }>();
Expand All @@ -33,9 +33,9 @@
if (!hasMore) return;
const target = e.target as HTMLElement;
const offset = calcOffset(target, reverse, horizontal);
const offset = calcOffset(target, reverse!, horizontal!);
if (offset <= threshold) {
if (offset <= threshold!) {
if (!isLoadMore && hasMore) {
dispatch("loadMore");
beforeScrollHeight = target.scrollHeight;
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4391,10 +4391,10 @@ supports-hyperlinks@^2.0.0:
has-flag "^4.0.0"
supports-color "^7.0.0"

svelte-dts@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/svelte-dts/-/svelte-dts-0.3.3.tgz#91e6d7270c56a547f72ff7af44c07e4a55f63de2"
integrity sha512-PWw4+OK4EUdCgflsTRUHMrtf1+5If94tmAvuJeq3CF1aNhiwmp7RtplMA0I7cNckbCnDJ/3gBpwFHdf7bQjVkQ==
svelte-dts@^0.3.7:
version "0.3.7"
resolved "https://registry.yarnpkg.com/svelte-dts/-/svelte-dts-0.3.7.tgz#ad1df3f5d23c72c0fc5dfbb5b9fdcfeb3b43d27f"
integrity sha512-gy5jIgL8R9IDBwfqvvzPwamEJufQyieEaS5D9drvtOi8rpWlg7ZuAnJ73ZjJK71o8ik8hIM3zx2XiPlLTDb/tQ==
dependencies:
commander "^7.1.0"
recursive-readdir "^2.2.2"
Expand Down

0 comments on commit c3072ad

Please sign in to comment.