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
### Keybase proof | |
I hereby claim: | |
* I am beorn on github. | |
* I am beorno (https://keybase.io/beorno) on keybase. | |
* I have a public key ASD0XyKJ06dYdc1Du37H0Ki9s4hgAOHu-GjBh_0JqAxsEQo | |
To claim this, I am signing this object: |
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
// NOTE: I did use ChatGPT for help fleshing this out | |
import React from "react" | |
// Global variable to track current computation for dependency tracking | |
let currentComputation: ComputedObservable<any> | null = null | |
// Observable class to handle state changes and subscriptions | |
class Observable<T> { | |
#value: T |
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
// NOTE: I did use Cursor/LLMs to help write this | |
import React from "react" | |
/** Base class for reactive values that can notify subscribers of changes */ | |
class Observable<T> { | |
protected _value: T | |
protected subscribers = new Set<() => void>() | |
/** Tracks dependencies during computed property evaluation */ | |
static currDeps: Set<Observable<any>> | null = null |
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
import React from "react" | |
/** Base class for reactive values that can notify subscribers of changes */ | |
class Observable<T> { | |
protected _value: T | |
protected subscribers = new Set<() => void>() | |
/** Tracks dependencies during computed property evaluation */ | |
static currDeps: Set<Observable<any>> | null = null | |
constructor(value: T) { |