mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-07 08:53:25 +01:00
18 lines
No EOL
301 B
JavaScript
18 lines
No EOL
301 B
JavaScript
export const NOOP = () => {};
|
|
|
|
export function createFunctionList() {
|
|
const fnList = [];
|
|
const add = fn => fnList.push(fn);
|
|
const call = () => {
|
|
fnList.forEach(fn => {
|
|
try {
|
|
fn();
|
|
} catch(e) {
|
|
console.error(e);
|
|
}
|
|
});
|
|
};
|
|
return {
|
|
add, call
|
|
}
|
|
} |