Add data structure callback observers
Closed this issue · 8 comments
As mentioned in #188, I developed an observer system to be notified by callback by pjs when the datastructure changes.
The code is currently meant to be loaded externally and thus uses monkey-patching to hook up with pjs. I also wrote some unittests showing how to use the patch.
In case you find this system useful, I could create a merge request and incorporate the code directly into the source code of pjs.
(Just a reminder to myself when I'll implement the observer directly in the library.)
I just noticed that the test for arrays in ProtocolBase.validate
does not check for ArrayWrapper
neither and should be expanded to make the observers survive. Additionally, the _parent
links need to be rewired in ArrayWrapper.__init__
.
So, what do you think? Should we make this an official part of pjs?
Oh, I updated the links. I had changed my username and the old links became invalid.
Stale issue message
Have you found some time to consider the changes?
this bot is quite bold