mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
feature: client: dom: events: migrate to ESM
This commit is contained in:
parent
071141bc5a
commit
e8a81c49ea
4 changed files with 18 additions and 22 deletions
|
|
@ -1,17 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
let list = [];
|
||||
|
||||
module.exports.add = (el, name, fn) => {
|
||||
list.push([
|
||||
el,
|
||||
name,
|
||||
fn,
|
||||
]);
|
||||
};
|
||||
|
||||
module.exports.clear = () => {
|
||||
list = [];
|
||||
};
|
||||
|
||||
module.exports.get = () => list;
|
||||
15
client/dom/events/event-store.mjs
Normal file
15
client/dom/events/event-store.mjs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
let list = [];
|
||||
|
||||
export const add = (el, name, fn) => {
|
||||
list.push([
|
||||
el,
|
||||
name,
|
||||
fn,
|
||||
]);
|
||||
};
|
||||
|
||||
export const clear = () => {
|
||||
list = [];
|
||||
};
|
||||
|
||||
export const get = () => list;
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
const {test} = require('supertape');
|
||||
const eventStore = require('./event-store');
|
||||
import {test} from 'supertape';
|
||||
import * as eventStore from './event-store.mjs';
|
||||
|
||||
test('event-store: get', (t) => {
|
||||
const el = {};
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import itype from 'itype';
|
||||
import EventStore from './event-store.js';
|
||||
import * as EventStore from './event-store.mjs';
|
||||
|
||||
/**
|
||||
* safe add event listener
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue