webpack/examples/worker/chat-module.js

7 lines
152 B
JavaScript

export const history = [];
export const add = (content, from) => {
if (history.length > 10) history.shift();
history.push(`${from}: ${content}`);
};