mouse-traker
v1.0.4
Published
this is mouse-tracking package to realtime to get mousemove or click event
Downloads
1
Maintainers
Readme
Mouse-Traker
Use the package manager to track mousemove and mouseclick event.
Installation
$ npm i mouse-traker
Importing
import { mouseTracker } from "mouse-traker"
Usage
Example Angular
app.component.ts
class AppComponent Implements OnInit {
title = "my-app"
public event : MouseEvent;
ngOnInit() {
this.event = mouseTracker((event)=>console.log(event), (event)=>console.log(event));
};
};
Example React
index.tsx
const Index = () => {
useEffect(()=> {
mouseTracker((event)=>console.log(event),(event)=>console.log(event));
},[]);
};