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
在看 TodoList example 时发现event产生依赖于TodoListModule的command,但是 command 实现细节是在remesh 内部的,需要使用者确定command确实对list产生了修改,如果ListModule对外暴露ListChangedEvent、ListItemAddedEvent等事件,外部就确定事件已发生可以直接使用。不知道有没有必要呢?如果有必要的话我想尝试提一下pr~
event
TodoListModule
command
remesh
list
ListModule
ListChangedEvent、ListItemAddedEvent
The text was updated successfully, but these errors were encountered:
Sorry, something went wrong.
@ScarboroughCoral ListModule 不暴露 Event 是已知的问题。最初是添加了 ItemAddedEvent, ItemDeletedEvent, ListChangedEvent 等事件,但后面发现,这些事件无法可靠地触发,因为 SetListCommand 可以将 List 整体替换,其中有些可能是 add 的新元素,有些可能是 delete 了,而有些可能 re-order 了。
这将导致业务逻辑依赖 ItemAddEvent 时,有些不是通过 AddItemCommand 添加的 added items 可能不会触发。
正因如此,remesh 才意欲引入 entity-component-system 和 entity-relationship model 等模型,掌控底层 state 的表征方式,以便得到更可靠的 state related events。
entity-component-system
entity-relationship model
目前的折衷做法是,ListModule 自身不暴露 event,由上层 domain 自己管理自己的 event 并保证它们的可靠性。后续 remesh 升级后或许会克服这类问题。
好的 确实是这样 了解了
No branches or pull requests
在看 TodoList example 时发现
event
产生依赖于TodoListModule
的command
,但是command
实现细节是在remesh
内部的,需要使用者确定command
确实对list
产生了修改,如果ListModule
对外暴露ListChangedEvent、ListItemAddedEvent
等事件,外部就确定事件已发生可以直接使用。不知道有没有必要呢?如果有必要的话我想尝试提一下pr~The text was updated successfully, but these errors were encountered: