Skip to content

moinCodes/useState-using-Proxy-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Demo: Mimicking React's useState Hook with JavaScript Proxy Object

This repository demonstrates how to replicate React's useState hook using JavaScript's Proxy object. The project features a simple counter application to illustrate how proxies can be used to create reactive state management.

Features

  • Implementing React’s useState behavior for reactivity.
  • Increment and decrement functionalities for the counter.
  • Toast notifications for invalid operations (e.g., negative values).
  • Clean and minimal UI with smooth animations.

Installation

1. Clone the repository:

  git clone https://github.com/your-username/proxy-useState-demo.git

2. Navigate to the project directory:

  cd proxy-useState-demo

Usage

Open index.html in your preferred web browser to see the demo in action.

License

MIT

About

Mimicking React's useState Hook with JavaScript Proxy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors