openreplay/frontend/app/player/common/SimpleStore.ts
Shekar Siri 8d8f320ddb
Player virtual dom lazy creation (#1174)
* feat(player): lazy JS DOM node creation; (need fixes for reaching  full potential)

* fix(player): drasticly reduce amount of node getter call during virtual node insertion

* feat(player/VirtualDOM): OnloadVRoot & OnloadStyleSheet for lazy iframe innerContent initialisation & elimination of forceInsertion requirement in this case;; few renamings

* style(player): few renamings; comments improved

* feat(player/DOMManager): VirtualNodes insertion prioretization (for styles)

---------

Co-authored-by: Alex Kaminskii <alex@openreplay.com>
2023-04-17 14:37:33 +02:00

13 lines
252 B
TypeScript

import { Store } from './types'
export default class SimpleSore<G, S=G> implements Store<G, S> {
constructor(private state: G){}
get(): G {
return this.state
}
update(newState: Partial<S>) {
Object.assign(this.state, newState)
}
}