/Juspay-Assignment

This is an attempt to implement the React useState hook functionality without using React or other library/framework.

Primary LanguageJavaScript

Juspay-Assignment

Objective: To implement functionality similar to React useState hook without using React and only Vanilla Javascript.

Demo link

Note: there are two branches in this repo --> main branch and "subscriber-and-listener" branch

main branch --> implements the useState hook using the concept of closures and similar to how react implements it. subscriber-and-listener branch --> implements the useState hook using the concept of subscriber and listener. Link of the subscriber-and-listener branch --> subscriber-and-listener

Limitations of this project:

  • Basic Scope: The project focuses on implementing a simplified version of the useState hook on a small scale. It doesn't cover more advanced features offered by state management libraries like React, such as context, reducers, or effects.

  • Performance: The project doesn't focus on performance optimizations. It doesn't use memoization or other techniques to avoid unnecessary re-renders.

  • Limited Functionality: While the project demonstrates the core concept of state management using custom functions , its important to note that the implemented system lacks features like asynchronous updates, derived state, and complex state transformations.

  • No webpack or bundlers are used here.