-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/dynamic query and dynamic render #8
Conversation
packages/core/src/core/proxy.js
Outdated
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) |
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.
函数的判断用 isFunction 就行
packages/core/src/core/proxy.js
Outdated
@@ -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) |
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.
dynamicRender 这个感觉叫 getAst 比较直观点?
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.
加个下划线前缀吧,约定是个比较私有的api
No description provided.