Skip to content

Commit

Permalink
docs: add usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
daltonmenezes committed Nov 8, 2022
1 parent 3a2bb96 commit 326030f
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 29 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<a href="#use-exit-intent">
<img alt="preview" src="./apps/web/public/banner.svg" width="100%">
<img alt="preview" src="https://github.com/daltonmenezes/use-exit-intent/raw/main/apps/web/public/banner.svg" width="100%">
</a>
</p>

Expand Down Expand Up @@ -43,6 +43,26 @@ yarn add use-exit-intent

npm i use-exit-intent
```

# 🐠 Usage

In your React component:

```tsx
import { useExitIntent } from 'use-exit-intent'

export function App() {
const { registerHandler } = useExitIntent()

registerHandler({
id: 'openModal',
handler: () => console.log('Hello from handler!')
})

// ...
}
```

# 🐠 Knowledge
- [Docs](https://daltonmenezes.github.io/use-exit-intent/docs/getting-started/overview)
- [Playground](https://daltonmenezes.github.io/use-exit-intent/#playground)
Expand Down
6 changes: 6 additions & 0 deletions packages/use-exit-intent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# use-exit-intent

## 1.0.5

### Patch Changes

- docs: add usage example

## 1.0.4

### Patch Changes
Expand Down
20 changes: 20 additions & 0 deletions packages/use-exit-intent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,26 @@ yarn add use-exit-intent

npm i use-exit-intent
```

# 🐠 Usage

In your React component:

```tsx
import { useExitIntent } from 'use-exit-intent'

export function App() {
const { registerHandler } = useExitIntent()

registerHandler({
id: 'openModal',
handler: () => console.log('Hello from handler!')
})

// ...
}
```

# 🐠 Knowledge
- [Docs](https://daltonmenezes.github.io/use-exit-intent/docs/getting-started/overview)
- [Playground](https://daltonmenezes.github.io/use-exit-intent/#playground)
Expand Down
26 changes: 0 additions & 26 deletions packages/use-exit-intent/docs/banner.svg

This file was deleted.

5 changes: 3 additions & 2 deletions packages/use-exit-intent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "use-exit-intent",
"version": "1.0.4",
"version": "1.0.5",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
Expand All @@ -25,7 +25,8 @@
"predev": "tsc",
"dev": "rollup -c -w",
"prebuild": "tsc",
"build": "rollup -c"
"build": "rollup -c",
"prepack": "cp ../../README.md ./README.md"
},
"devDependencies": {
"@daltonmenezes/eslint-config": "*",
Expand Down

0 comments on commit 326030f

Please sign in to comment.