Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sarojghalan/awakening_observer_pattern
The Observer pattern is a behavioral design pattern where an object, known as the subject, maintains a list of dependents, known as observers, that need to be notified of any changes in the subject's state. When the subject's state changes, it notifies all its observers, typically by calling one of their methods.
https://github.com/sarojghalan/awakening_observer_pattern
Last synced: 2 days ago
JSON representation
The Observer pattern is a behavioral design pattern where an object, known as the subject, maintains a list of dependents, known as observers, that need to be notified of any changes in the subject's state. When the subject's state changes, it notifies all its observers, typically by calling one of their methods.
- Host: GitHub
- URL: https://github.com/sarojghalan/awakening_observer_pattern
- Owner: sarojghalan
- Created: 2024-02-13T01:48:16.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-15T02:07:54.000Z (11 months ago)
- Last Synced: 2024-11-10T00:26:53.125Z (about 2 months ago)
- Language: TypeScript
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Awakening Observer Pattern
Welcome to the Observer Pattern Playground! 🎉
This repository serves as a sandbox for exploring Observer Patterns in React. The Observer pattern is a behavioral design pattern where an object, known as the subject, maintains a list of dependents, known as observers, that need to be notified of any changes in the subject's state. When the subject's state changes, it notifies all its observers, typically by calling one of their methods. This pattern is commonly used in scenarios where you have one-to-many relationships between objects, and you want to ensure that changes to one object's state are reflected in other objects. The Observer pattern promotes loose coupling between objects, making it easier to maintain and extend the codebase.
In this playground, you'll find example showcasing Observer Patterns implemented using React. Whether you're new to Observer Patterns or an experienced developer looking for inspiration, this repository is a perfect starting point to experiment, learn, and create amazing user interfaces.
## Key Features
- Subject: Maintains a list of observers and notifies them of state changes.
- Observer: Registers with a subject to receive notifications and updates its state accordingly.
- Loose Coupling: Objects are decoupled, allowing for easier maintenance and scalability.
- One-to-Many Relationship: Enables broadcasting changes to multiple dependent objects efficiently.## Use Cases
- State Management: Update UI components when underlying data changes.
- Event Handling: Notify components of user interactions or system events.
- Data Binding: Synchronize changes in data with changes in the UI.
## Tools and Tech- [React JS](https://react.dev/)
- [Typescript](https://www.typescriptlang.org/)
- [Observer Pattern](hhttps://www.patterns.dev/vanilla/observer-pattern)## Run Locally
Clone the project
```bash
git clone https://github.com/sarojghalan/Awakening_Observer_Pattern.git
```Go to the project directory
```bash
cd Awakening_Observer_Pattern
```Install dependencies
```bash
pnpm install
```Start the server
```bash
pnpm run start
```## Authors
- [Sarojghalan](https://github.com/sarojghalan)