This repository has been archived by the owner on Nov 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Observer pattern live demo #99
Open
Dhuds1
wants to merge
49
commits into
nic-dgl104-winter-2024:main
Choose a base branch
from
Dhuds1:dhuds-dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 SANITYI still do not understand why I've created such a monstrosity of a file