Sabbatical dev

sabbatical devtechnical blog
 

Manage State in React without Redux or Context

Meet the Observer pattern

After implementing the observer pattern in Typescript I wondered if I could use it in a React application.

You can find the basic implementation of the pattern taken from the book Head First Design Patterns here on my GitHub and an implementation of it where I am using it to manage state across components here. The running application can be found here:

I was just interested to see the pattern in action and don't really see it being of great use - but I thought it maybe worth a share.

I created a video to explain it as I was to lazy to type 😉




Comments

Add a comment