-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
refactor: move some functions and module-level state into classes as private methods and properties to start to encapsulate Docsify #2136
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
5c49d1e
to
2e5787f
Compare
…private methods and properties to start to encapsulate Docsify Also some small tweaks: - move initGlobalAPI out of Docsify.js to start to encapsulate Docsify - move ajax to utils folder - fix some type definitions and improve content in some JSDoc comments - use concise class field syntax - consolidate duplicate docsify-ignore comment removal code This handles a task in [Simplify and modernize Docsify](#2104), as well as works towards [Encapsulating Docsify](#2135).
2e5787f
to
9f8c3c9
Compare
d7bbb50
to
9f8c3c9
Compare
src/core/event/index.js
Outdated
#enableScrollEvent = true; | ||
#coverHeight = 0; | ||
|
||
#scrollTo(el, offset = 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic was not changed, only moved.
src/core/fetch/index.js
Outdated
|
||
/** | ||
* @template {!Constructor} T | ||
* @param {T} Base - The class to extend | ||
*/ | ||
export function Fetch(Base) { | ||
let last; | ||
return class Fetch extends Base { | ||
#loadNested(path, qs, file, next, vm, first) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic was not changed, only moved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we change all the _private
stuff to #private
into ES6? otherwise, it seems messy here with both format.
Summary
Also some small tweaks:
Related issues
This handles a task in
as well as works towards
Continues from PR
What kind of change does this PR introduce?
Code style update
Refactor
For any code change,
Does this PR introduce a breaking change? (check one)
No
If yes, please describe the impact and migration path for existing applications:
Tested in the following browsers: