Skip to content
This repository was archived by the owner on Jan 18, 2026. It is now read-only.

Its-Just-Nans/events-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

events-hook

Easily sharing state between component

Example

import { useGetValue } from "events-hook";

export const Receiver = () => {
    const value = useGetValue("test");
    return <div>{JSON.stringify(value)}</div>;
};
import { useSetValue } from "events-hook";

export const Setter = () => {
    const setter = useSetValue("test");
    return (
        <input
            onChange={(currentEvent) => {
                setter(currentEvent.target.value);
            }}
        />
    );
};

See example/ for a working example

License

Licensed under the MIT License - LICENSE

About

Easily sharing state between component

Topics

Resources

License

Stars

Watchers

Forks

Contributors