# click-should-be-intercepted-for-navigation

> Given a click event, returns true if it's a left-click that you should intercept to trigger pushState navigation

Latest version **1.1.0** (published 2021-12-22) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install click-should-be-intercepted-for-navigation
pnpm add click-should-be-intercepted-for-navigation
yarn add click-should-be-intercepted-for-navigation
bun add click-should-be-intercepted-for-navigation
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-12-22 |
| First published | 2017-08-28 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | TehShrike |
| Maintainers | tehshrike |
| Keywords | link, click, event, navigation, pushState |

## Links

- npm: https://www.npmjs.com/package/click-should-be-intercepted-for-navigation
- Repository: https://github.com/TehShrike/click-should-be-intercepted-for-navigation
- Homepage: https://github.com/TehShrike/click-should-be-intercepted-for-navigation#readme
- Issues: https://github.com/TehShrike/click-should-be-intercepted-for-navigation/issues
- npm.io page: https://npm.io/package/click-should-be-intercepted-for-navigation

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-12-22
- 1.0.0 — 2017-08-28

## README

Given a click event, returns true if it's a left-click that you should intercept to trigger pushState navigation.

Taken from React Router's [Link](https://github.com/ReactTraining/react-router/blob/75854190361f6800788bddfc76d15f8624ef9d89/packages/react-router-dom/modules/Link.js#L45-L48) component.

```js
const shouldInterceptClick = require('click-should-be-intercepted-for-navigation')

function onClick(event) {
	if (shouldInterceptClick(event)) {
		// do your pushState-based navigation here
	}
}
```

---
_Source: https://npm.io/package/click-should-be-intercepted-for-navigation · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
