new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Mantine · all subjects

hooks/useidle

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

useIdle hook detects user inactivity

The useIdle hook detects if the user does nothing for a given time specified in milliseconds. It returns a boolean indicating whether the user is idle.

useIdle default events monitored

By default, the useIdle hook listens to keydown, mousemove, touchmove, click, scroll, and wheel events to determine idle status.

useIdle default initial state

By default, the useIdle hook returns an idle state initially.

useIdle hook signature and options

The useIdle hook has the signature: function useIdle(timeout: number, options?: UseIdleOptions): boolean. The timeout parameter is required and specifies the time in milliseconds before the user is considered idle. The optional options parameter accepts a UseIdleOptions object.

UseIdleOptions interface definition

The UseIdleOptions interface contains two optional properties: events (an array of DocumentEventMap keys to customize which events trigger the idle state), and initialState (a boolean to set the initial idle state value).

UseIdleOptions type import

The UseIdleOptions type is exported from @mantine/hooks and can be imported with: import type { UseIdleOptions } from '@mantine/hooks';

Give your agent this brain