You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class TodoStore {
@observable list = []
@observable fetched = false
@action emit = (url) => {
this.fetched = true
socket.emit(url)
}
@computed get on(){
socket.on('get list',(json)=>{
this.fetched = false
this.list = json.map((index,i)=>{
return new List(index)
})
})
}
}
mobx正常模式没问题,严格模式下
[mobx] Invariant failed: Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: [email protected]
mobx正常模式没问题,严格模式下
mobx一直给我报错,我把接收socket.on函数放在外面,接收函数就根本不会触发。想知道你是如何处理好客户端的socket的发送与接收的。。。。
socket的接收是不是应该放在组件里面作为一个时刻可以接收信息的可以被任意随时触发的XXX?
The text was updated successfully, but these errors were encountered: