{"id":15789860,"url":"https://github.com/captaincodeman/svelte-disable-preload","last_synced_at":"2026-02-26T00:33:41.035Z","repository":{"id":65589220,"uuid":"595291064","full_name":"CaptainCodeman/svelte-disable-preload","owner":"CaptainCodeman","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-29T20:13:40.000Z","size":71,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T22:14:24.283Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CaptainCodeman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-30T19:35:07.000Z","updated_at":"2024-04-29T20:13:43.000Z","dependencies_parsed_at":"2024-10-28T09:13:57.028Z","dependency_job_id":"406abecc-1693-47ce-9a85-ef4a24985317","html_url":"https://github.com/CaptainCodeman/svelte-disable-preload","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"bf259add5d51fafb6dd6df8e54fe0138fb5a938e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Fsvelte-disable-preload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Fsvelte-disable-preload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Fsvelte-disable-preload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptainCodeman%2Fsvelte-disable-preload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CaptainCodeman","download_url":"https://codeload.github.com/CaptainCodeman/svelte-disable-preload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246552961,"owners_count":20795835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-04T22:03:59.942Z","updated_at":"2026-02-26T00:33:40.965Z","avatar_url":"https://github.com/CaptainCodeman.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# svelte-disable-preload\n\n![minified](https://img.shields.io/bundlephobia/min/svelte-disable-preload/0.0.2?style=for-the-badge)\n![minified + zipped](https://img.shields.io/bundlephobia/minzip/svelte-disable-preload/0.0.2?style=for-the-badge)\n\nSveltKit provides a client-side router that handles navigation when anchor elements are clicked. It can also be [configured to preload data](https://kit.svelte.dev/docs/link-options) to make your app seem \"snappier\". It does this by listening for various `click`, `mousedown`, `mousemove`, and `touchstart` events on the document which will bubble from elements.\n\nFor typical \"web-app\" use, this is no problem. But if you're working with HTML `canvas` elements and `requestAnimationFrame` animations, you may not want these extra event handlers being invoked - it can introduce a slight 'juddering' effect and spoil an otherwise smooth animation.\n\nThere is [an option to disable it](https://kit.svelte.dev/docs/link-options#disabling-options) but this only disables the _behavior_ from being invoked, i.e. the preloading itself - the event listeners are still there.\n\nThis package provides a simple action to apply noop event listeners to an element that prevent the document-level SvelteKit event handlers being invoked.\n\n## Usage\n\nInstall using your package manager of choice, e.g.\n\n    pnpm i svelte-no-preload\n\nImport it into your component and `use:` it on an element:\n\n```svelte\n\u003cscript lang=\"ts\"\u003e\n  import { disablePreload } from 'svelte-disable-preload'\n\u003c/script\u003e\n\n\u003ccanvas use:disablePreload /\u003e\n```\n\nYour canvas interactions should now be slightly smoother.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptaincodeman%2Fsvelte-disable-preload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaptaincodeman%2Fsvelte-disable-preload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaptaincodeman%2Fsvelte-disable-preload/lists"}