tnfe / clean-state Goto Github PK
View Code? Open in Web Editor NEW🐻 A pure and compact state manager, using React-hooks native implementation, automatically connect the module organization architecture. 🍋
License: MIT License
🐻 A pure and compact state manager, using React-hooks native implementation, automatically connect the module organization architecture. 🍋
License: MIT License
问题:父组件A下面有2个子组件B,C,他们三个分别都有自己的状态,并且需要数据共享,还可以触发相互之间的效应。
按照给出的Mixin方法,需要在子组件B, C单独定义自己的module,在父组件定义自己的common module。通过import提升,在父组件里面先导入子组件的Modue,然后调用minxin()混合modules,再调用bootstrap()注册到state。
这样有一个问题,父组件需要import所有子组件的module,相互耦合很强。
请问最佳结构是怎么设计?
能否在父组件和子组件分别先独立注册自的模块,然后子组件再独立混合到父组件中,达到共享状态的办法。
谢谢!
如题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.