Skip to content

Instantly share code, notes, and snippets.

@selcukcihan
Created March 31, 2020 13:07
Show Gist options
  • Save selcukcihan/4c6e6964ce16992c24f07ec1c7fff867 to your computer and use it in GitHub Desktop.
Save selcukcihan/4c6e6964ce16992c24f07ec1c7fff867 to your computer and use it in GitHub Desktop.
Native modül, default export'lu örnek
import sleep from './utils.js'
console.log(`3000 milisaniye uyuyalım `);
sleep(3000);
{
"name": "moduller",
"type": "module"
}
const DEFAULT_SLEEP_MILLISECONDS = 1000;
function sleep(milliseconds) {
return new Promise(resolve =>
setTimeout(resolve, milliseconds || DEFAULT_SLEEP_MILLISECONDS)
);
}
export default sleep;
export { DEFAULT_SLEEP_MILLISECONDS, sleep };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment