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.

28 lines (24 loc) 558 B
/*! * NENT 2022 */ 'use strict'; const index = require('./index-637e8c28.js'); const interfaces = require('./interfaces-95d0415a.js'); /* istanbul ignore file */ class InMemoryProvider { constructor() { this.data = {}; this.changed = new index.EventEmitter(); } async get(key) { return this.data[key] || null; } async set(key, value) { this.data[key] = value; this.changed.emit(interfaces.DATA_EVENTS.DataChanged); } destroy() { this.changed.removeAllListeners(); } } exports.InMemoryProvider = InMemoryProvider;