svelte-page-router icon indicating copy to clipboard operation
svelte-page-router copied to clipboard

next is undefined

Open Manuelbaun opened this issue 4 years ago • 1 comments

Hi, i just wanted to try out your library and found that when using hook, in

(ctx, next) => {
    // do something 
    next();
}

next is undefined.

I spotted the issue in your index.mjs on line 23, when you call the hooks

Promise.all(this._hooks.map((p) => p(ctx))).then(next);

but shouldn't it be like this:

Promise.all(this._hooks.map((p) => p(ctx, next))).then(next);

Manuelbaun avatar Feb 06 '20 23:02 Manuelbaun