https://github.com/baptistelambert/hyperapp-idle
😴 Notifies you app when the user is idle.
https://github.com/baptistelambert/hyperapp-idle
hyperapp idle render-prop
Last synced: 8 months ago
JSON representation
😴 Notifies you app when the user is idle.
- Host: GitHub
- URL: https://github.com/baptistelambert/hyperapp-idle
- Owner: baptistelambert
- Created: 2018-02-19T21:13:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-22T10:17:01.000Z (over 8 years ago)
- Last Synced: 2025-08-27T04:11:54.808Z (10 months ago)
- Topics: hyperapp, idle, render-prop
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/hyperapp-idle
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hyperapp-idle
Notifies your app when the user is idle.
Inspired by [react-idle](https://github.com/ReactTraining/react-idle).
## Installation
```
npm install hyperapp-idle
# or with yarn
yarn add hyperapp-idle
```
## Usage
```js
import { h, app } from 'hyperapp';
import { Idle } from 'hyperapp-idle';
const state = {
idle: false
};
const actions = {
updateIdle = idle => state => ({ idle })
};
const view = (state, actions) => (
{idle ? 'You are idle.' : 'You are active.'}}
/>
)
app(state, actions, view, document.body);
```