-
-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
experiment with a Store<K> parameter for Reflectors - #102
in an effort to solve #102 we try to factor out the implicit data store inside Reflector<K> as a trait object that can be customized. The abstraction, feels very rigid, and not sure how useable it is. Ultimately, I wanted a nicer interface for users of library that wasnt "give me a CLONE of ALL state" or "give me one thing with a matching ID". It's potentially possible to take type that implemented iterator with this approach, as well as MAYBE handing out an arc'd clone to users (provided they are told not to keep it locked for ages). Another problem I wanted to solve was having the stored state be a simplified version of the underlying data (i.e. add/modify would perform some kind of transformation before storing it). This was super awkward with the old Reflector setup because you'd effectively force two whole clones of the two types, and you'd have to recreate your shadow tree every time you asked for the state (which was ALL of the input).
- Loading branch information
Showing
1 changed file
with
82 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters