Skip to content

Instantly share code, notes, and snippets.

View keithamus's full-sized avatar
:fishsticks:

Keith Cirkel keithamus

:fishsticks:
View GitHub Profile
@keithamus
keithamus / store.js
Created July 11, 2022 10:29
Reducer State management library, similar to Redux, using EventTarget
class Store extends EventTarget {
constructor(reducer, state) {
super()
this.#reducer = reducer
this.#state = state
}
get state() {
return this.#state
}
dispatch(action) {