ARK-Builders / ark-core

The core of the ARK framework
MIT License
4 stars 4 forks source link

Improve `ResourceIndex::update_one()` for More Detailed Events #89

Open tareknaser opened 2 months ago

tareknaser commented 2 months ago

Currently, ResourceIndex::update_one() returns a Result<IndexUpdate<Id>>, which basically just includes a couple of hashsets for added and removed resources. This is simple so that it matches the return type of update_all().

However, we should consider enhancing update_one to provide more detailed events. This could make the Track API and Watch API more powerful compared to the Reactive API. The goal is to support finer-grained events, similar to what notify-rs offers, including not just add/remove events but also rename and modify events.

For more context, see https://github.com/ARK-Builders/ark-core/pull/36#discussion_r1751927054

kirillt commented 2 months ago

Also, we can consider returning enum from update_one (instead of struct), since only one path can be updated. But this is only possible if we have dedicated enum variants for modifications and renamings.