kiesun / chat-buy-react Goto Github PK
View Code? Open in Web Editor NEWClient for beginners to learn, built with React / Redux / Node
License: GNU General Public License v3.0
Client for beginners to learn, built with React / Redux / Node
License: GNU General Public License v3.0
// actions/chat.js 中的connectSocket函数
export function connectSocket() {
return (dispatch, state) => {
const orders = state()
.get("user")
.get("orders");
// ....
}
}
这里只在调用了connectSocket函数时才去拿orders的数据,这个时候应该还没有从服务端拿到数据,所以这里的orders应该是空的,在监听getOrder事件时用的是这里的orders,导致不执行dispatch
socket.on("getOrder", data => {
console.log(orders.isEmpty()) // true
if (!orders.isEmpty()) {
dispatch(getOrderSuccess(data));
}
});
其实这个只是选择问题,只是想问下选择express4的理由是?
一个小建议而已
when I register i meet an error, it seems to be a problem with proxyable. I just modify port.
Proxy error: Could not proxy request /user/register from localhost:3000 to http://localhost:27017/. See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNRESET).
cmd : npm run server
alway show this messages
[nodemon] restarting due to changes..
Thanks ! It looks like very good.
It's possible to have an english translation of the client please ?
Thanks !
Could not proxy request /user/register from localhost:3000 to http://localhost:1717/
首先,这是一个很好的项目,但是有个点想和大家讨论一下:
就是 components 的组件应该只和渲染有关,不关心数据和路由。数据和路由应该由 containers 中的组件去做,这个项目中 containers 中的部分组件直接包了一层 components 中的组件就导出了,应该是不太合适的。有些 components 中的组件直接访问了 redux 和 router,感觉也不太合适。
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.