0.0.6 • Published 3 years ago

origen v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

ORIGEN

npm GitHub license

A zero dependency, React utility library, filled with useful hooks to make your React experience even better.

useBoolValue

For maintaining the value of a boolean and being able to toggle it's value between true and false;

import { useBoolValue } from 'origen';

export default function App() {
  const [value, toggleValue] = useBoolValue(false);

  return (
    <div>
      <h1>My value is: {value}</h1>
      <button onClick={toggleValue}>Toggle</button>
    </div>
  );
}

useMousePosition

For getting the current x and y coordinates of the mouse cursor.

import { useMousePosition } from 'origen';

export default function App() { const mousePosition = useMousePosition();

return (

<div>
  <h1>Width: {mousePosition.x}</h1>
  <h1>Height: {mousePosition.y}</h1>   
</div>

); }

---

#### `useWindowDimensions`

> For getting the current `width` and `height` values of the window.

```js
import { useWindowDimensions } from 'origen';

export default function App() {
  const dimensions = useWindowDimensions();

  return (
    <div>
      <h1>Width: {dimensions.width}</h1>
      <h1>Height: {dimensions.height}</h1>      
    </div>
  );
}

License

ORIGEN is MIT licensed.

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago