Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Observer pattern live demo #99

Open
wants to merge 49 commits into
base: main
Choose a base branch
from

Conversation

Dhuds1
Copy link
Collaborator

@Dhuds1 Dhuds1 commented Mar 28, 2024

I wanted to create an observer pattern live demo to showcase how the observer pattern functions and can be used. As of this moment it is not completed but I wanted to share it to hopefully get some feedback!

There are two primary reasons I started this project, the first is I has a hard time understanding this pattern and its use cases, and the second reason is I wanted write some JS, which is something I haven't used in a while.

I didn't use any sources, or other materials to create this, but I did use chat GPT as a documentation of sorts, since its been a while since I've used JS I've forgotten things like adding to an array, mutating an array etc. and I was too lazy to search every question on google.

As of right now, the only things that are functional on the GUI / website version are adding Observer and Subject objects, it will also save them into your local host.

I'm still needing to add Subscribing, Unsubscribing, Data setting, updating and setting the delay functionality.

The delay functionality is really how this comes together, as it will complete one of the steps setting data, updating observer, asking subject for the new data, displaying new data

Most things will work in the backed, like subscribing and unsubscribing, data setting, data getting, updating etc. but not on the front end, having a user mutate and change the data themselves, which was the purpose of this file.

I will say this warning

DO NOT LOOK AT PRINT.JS IF YOU VALUE YOUR SANITY

I still do not understand why I've created such a monstrosity of a file

@ash-teach
Copy link
Member

Oof. This is a lot of work! I've taken a scan through, and I see what you're up to - it's a good idea! - though I haven't dived deep into it for a full assessment.

I'll leave this one open in case you ever decide to come back to it, or in case anyone stumbles across and would like to provide some feedback at some point.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants