The Changes contains new value and old value to get the boolean value that indicates if the property has been updated.
If the value struct is a large structure, deallocation will take many CPU usages.
Even if empty function does nothin, hashChanges is true. Why is that? I made the derived pipeline type memoized, still it has no effects. I also set counter the same value, hasChanges again true.
I did not understan why we need Verge Orm? Which case should we add to our project? Can you give some use cases for understanding? I think, in Verge we really do not normalizaton stuff like in Mobx. Am ı wrong?
Hi again,
I explored all the source code of the Verge. I understood that commit function is atomic operation. I thought it was kind of database transaction thing. My question is if any error throws in commit function ,the commit function rollback to old state? Because in db, this kind of thing it's successfuly made or failed.
Many times to create Derived from .chain
notifying and memorization also have a little bit of cost to perform.
if chaining condition is same, we can return shared derived.
I'm trying to use Verge and VergeORM in my application. Right now I have a very small model with a couple entries and I'm trying to list all the entries using SwiftUI:
VStack{StoreReader(Pickup.shared.store){ state inVStack{ForEach(state.database.entities.home.allEntities()){ home inText("\(home.rawID)")}}}}
But on the StoreReader line, I get the following error: Initializer 'init(debug:_:content:)' requires that 'EventEmitter<_StoreEvent<State, Never>>' conform to 'DispatcherType'
This seems to only happen if I add the ForEach block. Let me know if there's another way I should be doing this :~)
You refer store object even though it's used only for dispatching action. Does it bring extra performance loss since any change in store will trigger view re-rendering? If yes, what is the good way to minimize this kind of loss?
structMyView:View{letstore:MyStorevarbody:someView{UseState(store){ state inText(state.name)Button(action:{self.store.myAction()}){Text("Action")}}}}