Need a little more chaos in your life? Set a goose loose on your site to act like a jerk.
Nobody asked for this. – Jessica Tremblay
This is the worst thing you have ever done. – E.J. Mason
When activated, all links and buttons on the site will stop working, instead triggering a “honk!” sound effect.
This is not transpiled and not tested on any browsers except Chrome latest, because this is a silly joke and therefore honk honk honk!
yarn add honkify
In your code:
import honkify from 'honkify';
// The goose is loose!
const unregister = honkify();
// Disable so links work again
unregister();
You can also use the handy React Hook (or React Honk?) to make any event handler honkable
import useHonk from 'honkify/useHonk';
const onClick = (isLoose) => {
console.log(`goose is ${isLoose ? 'loose' : 'STILL LOOSE'}`);
}
function App() {
const honkify = useHonk();
const onClickHonkified = honkify(onClick);
return (
<h1 onClick={() => onClickHonkified(true)}>Sure, the header is honked too!</h1>
)
}
Or, if you do, make sure it’s easy to toggle off. Geese may be jerks, but developers shouldn’t be.