reginer / mvvmhub Goto Github PK
View Code? Open in Web Editor NEWMVVMHub
License: MIT License
MVVMHub
License: MIT License
一般情况下是很方便,但是在某些情况下需要扩展,实际使用中感觉sealed写法缺乏扩展性。
一开始我的解决方案是:
另外再开一个,和网络请求的State独立开
但是我发现某些情况下我需要合在网络请求的State里面一起通知activity:
比如我分页的时候我需要在返回数据的同时告诉Activity这是刷新的数据还是加载更多的数据(isRefresh),如果按照上面的独立开得方案,总觉得不太对劲,感觉会在某些情况下产生bug。
isRefresh类似的参数添加方式:
如果为了一个参数重新写一个通用的PageViewState感觉不划算,因为有很多相同部分,而且相关扩展也要对应写一份。
或者直接在原有的State上面加一个很多时候用不到的参数感觉也不是太舒服,如果之后还有其他的参数岂不是越加越多?
刚哥给点意见?
写的很好,可惜等你写完的下一秒就是我的了
Ps:
1.buildSrc是干嘛的
2.common准备写啥,为什么是空白的
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.