react-hooks-use-offscreen-drawing-canvas
v0.1.3
Published
A react hook for 2d drawing off the main thread
Downloads
2
Readme
Use Offscreen Drawing Canvas
This module is based on my simmilar module react-hooks-use-drawing-canvas that runs the drawing code on the main thread. When running potentially complex drawings however, the main thread will block while drawing calculation is being done.
To overcome this, we can make use of the
OffscreenCanvas
interface, and run the drawing method in a web-worker thread that will never
block the main thread. Even while it is calculating!
Installation
yarn add react-hooks-use-offscreen-drawing-canvas