This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.keybindr = (() => { | |
// Declare set of keys that are pressed | |
const keys = new Set(); | |
// Declare "associative array" of bindings to callback | |
const bindings = []; | |
function tokenizeKeys(keys){ | |
// Get array of different keys from string | |
return keys.split("+"); | |
} | |
window.addEventListener("keydown", ({key}) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function fmait(callbacks, array) { | |
for (const callback of callbacks) { | |
array = await Promise.all(array.map(item => Promise.resolve(callback(item)))); | |
} | |
return array; | |
} |
NewerOlder