We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Halation在进行module register的时候是依靠load.strategy来实现对于module是否记载的处理
load.strategy
export default function PluginComponent() { return { name: 'plugin-a', loader: { strategy: [{ type: 'ban', resolver: () => {} },{ type: 'flags', resolver: () => {} }, { type: 'event', resolver: () => {} }, { type: 'runtime', resolver: () => {} }], } } }
类型的话,主要是分为下面的四种
enum StrategyType { // 你可以认为这个属于偏静态的约束方式,比如当进入商详的时候,goodsId其实已经知道了;比如可以通过 // ban 进行一些黑名单的约束 ban, // 函数会接受flags flags, // 应用自定义的render phase; event, // 可能会依赖model在runtime时的值;这个其实就是与业务耦合,需要通过值的判断进行是否加载模块的判断 // 其实这个halation中更经常碰到的问题 runtime, }
对于loader的使用方式,他们最后值的合并类似&&的关系
上面的方式只是解决了普遍情况的问题,但是还有一种情况;
目前Halation提供的方式是对component进行registerModuleMap属性的注入,直接通过registerModuleMap拿到对应的module然后调用load的方式进行加载
const B = props => { const { registerModuleMap } = props const load = registerModuleMap.get('A') load() }
useRender
The text was updated successfully, but these errors were encountered:
related to
Sorry, something went wrong.
No branches or pull requests
Halation在进行module register的时候是依靠
load.strategy
来实现对于module是否记载的处理类型的话,主要是分为下面的四种
对于loader的使用方式,他们最后值的合并类似&&的关系
上面的方式只是解决了普遍情况的问题,但是还有一种情况;
目前Halation提供的方式是对component进行registerModuleMap属性的注入,直接通过registerModuleMap拿到对应的module然后调用load的方式进行加载
Maybe
useRender
function.The text was updated successfully, but these errors were encountered: