Skip to content

Async afterEach hook breaks ready and doneEach hooks #449

Description

@imyelo

Async afterEach hooks such as:

$docsify.plugins=[].concat(install,$docsify.plugins)functioninstall(hook,vm){hook.afterEach(function(html,next){setTimeout(function(){next(html)},1000)})}

breaking doneEach events dependent plugins, such as zoom-image.

Demo:
https://docsify-pagination-issue-1-nzhdhlzryc.now.sh/#/
Source of demo:
https://docsify-pagination-issue-1-nzhdhlzryc.now.sh/_src

(Came from imyelo/docsify-pagination#1)

I guess the next function in this place should run after callback:
https://github.com/QingWei-Li/docsify/blob/e5a263f1bb0909e1629abf76e327f7f2b50340d8/src/core/render/index.js#L149

For the current version, however, if callback is an asynchronous function, this assumption will be broken.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugconfirmed as a bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions