webpack/examples/module-worker/chat-module.js

7 lines
152 B
JavaScript
Raw Normal View History

2021-06-28 18:30:25 +08:00
export const history = [];
export const add = (content, from) => {
if (history.length > 10) history.shift();
history.push(`${from}: ${content}`);
};