async-exit-hook icon indicating copy to clipboard operation
async-exit-hook copied to clipboard

Misleading readme example

Open dansgithubuser opened this issue 6 years ago • 1 comments

callback is always called https://github.com/Tapppi/async-exit-hook/blame/80e692c88e62a88cf5750460ff02c28298e5b09b/readme.md#L60

callback is not always provided https://github.com/Tapppi/async-exit-hook/blob/80e692c88e62a88cf5750460ff02c28298e5b09b/index.js#L39

should be

exitHook(callback => {
    setTimeout(() => {
        console.log('exiting 3');
        if(callback) callback();
    }, 1000);
});

dansgithubuser avatar Jul 20 '18 16:07 dansgithubuser

So the source code says it can't call async callbacks on exit. Is this correct? I'm kind'a facing this issue right now and not sure if it's supported or not.

okonet avatar Sep 08 '18 08:09 okonet