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

Feature/dynamic query and dynamic render #8

Merged
merged 5 commits into from
Apr 22, 2024

Conversation

mater1996
Copy link
Collaborator

No description provided.

const effect = this.effect = new ReactiveEffect(() => {
// pre render for props update
if (this.propsUpdatedFlag) {
this.updatePreRender()
}
if (dynamicTarget || _dr) {
const ast = (_dr && typeof _dr === 'function') ? _dr() : dynamic.getAst(moduleId)
Copy link
Owner

Choose a reason for hiding this comment

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

函数的判断用 isFunction 就行

@@ -571,15 +571,22 @@ export default class MpxProxy {
const _r = this.target._r.bind(this.target)
const _sc = this.target._sc.bind(this.target)
const _g = this.target._g.bind(this.target)
const _dr = this.target.dynamicRender?.bind(this.target)
const _dr = this.target.dynamicRender?.bind(this.target)
Copy link
Owner

Choose a reason for hiding this comment

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

dynamicRender 这个感觉叫 getAst 比较直观点?

Copy link
Owner

Choose a reason for hiding this comment

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

加个下划线前缀吧,约定是个比较私有的api

@CommanderXL CommanderXL merged commit d700963 into feat-dynamic-v2 Apr 22, 2024
2 of 4 checks passed
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.

2 participants