Skip to content

Instantly share code, notes, and snippets.

@dolvik
Created April 12, 2017 11:59
Show Gist options
  • Save dolvik/0f214a8dfb7faddc69a7f956043d45ee to your computer and use it in GitHub Desktop.
Save dolvik/0f214a8dfb7faddc69a7f956043d45ee to your computer and use it in GitHub Desktop.
Small util functions
const delayed = (ms, fn, ctx) => (...args) => {
setTimeout(fn.bind(ctx, ...args), ms);
};
const revert = (arr) => arr.reduce((acc, curr, i, arr) => acc.concat(arr[arr.length - i - 1]), [] );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment