UNPKG

@mantine/hooks

Version:

A collection of 50+ hooks for state and UI management

1 lines 476 B
{"version":3,"file":"use-force-update.cjs","names":[],"sources":["../../src/use-force-update/use-force-update.ts"],"sourcesContent":["import { useReducer } from 'react';\n\nconst reducer = (value: number) => (value + 1) % 1000000;\n\nexport function useForceUpdate(): () => void {\n const [, update] = useReducer(reducer, 0);\n return update;\n}\n"],"mappings":";;;AAEA,MAAM,WAAW,WAAmB,QAAQ,KAAK;AAEjD,SAAgB,iBAA6B;CAC3C,MAAM,GAAG,WAAA,GAAA,MAAA,YAAqB,SAAS,EAAE;AACzC,QAAO"}