Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it Possible to Force CustomJS to Load Before Continuing #30

Merged
merged 3 commits into from
May 2, 2022
Merged

Make it Possible to Force CustomJS to Load Before Continuing #30

merged 3 commits into from
May 2, 2022

Conversation

iamrecursion
Copy link
Contributor

@iamrecursion iamrecursion commented Apr 30, 2022

This PR introduces the global forceLoadCustomJS asynchronous function. Awaiting this function allows the user to ensure that the customJS variable is defined in their script when Obsidian's initialisation does not.

Closes #29.

This ensures that it can be used from other plugins (e.g. templater)
that run tasks onLayoutReady without racing and potentially not having
window.customJS defined.
Copy link
Owner

@saml-dev saml-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Great docs too 😁

@saml-dev saml-dev merged commit 217cb61 into saml-dev:master May 2, 2022
@saml-dev
Copy link
Owner

saml-dev commented May 2, 2022

I never automated the release process so I will manually cut a release right now 😁

@iamrecursion iamrecursion deleted the wip/ara/awaitable-customjs branch May 2, 2022 17:07
@iamrecursion
Copy link
Contributor Author

Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

customJS is Not Defined in Templater Startup Template
2 participants