UNPKG

@nent/core

Version:

Functional elements to add routing, data-binding, dynamic HTML, declarative actions, audio, video, and so much more. Supercharge static HTML files into web apps without script or builds.

26 lines (23 loc) 531 B
/*! * NENT 2022 */ import { E as EventEmitter } from './index-f7016b94.js'; import { D as DATA_EVENTS } from './interfaces-8c5cd1b8.js'; /* istanbul ignore file */ class InMemoryProvider { constructor() { this.data = {}; this.changed = new EventEmitter(); } async get(key) { return this.data[key] || null; } async set(key, value) { this.data[key] = value; this.changed.emit(DATA_EVENTS.DataChanged); } destroy() { this.changed.removeAllListeners(); } } export { InMemoryProvider as I };