Comments (5)
Hi,
First - thanks for the kudos down there.
Regarding the object referentiality - I see your point, you are right. And indeed it is either to preserve standard objects behavior (should still see what would be the price) or allow some limitation here. I prefer, of course, to go first - let me think about it.
Regarding the revokation - looks also right to me, I'll just verify that i'm not missing something that was intentionally making me do it at earliest point and if none - will fix it.
from object-observer.
Hi,
I've played around the issues that you've raised here and there, it took me some time, but finally I have something to say about them (hopefully something smart :)).
Let's start from the last one, the remark that if a child object is replacing the parent in the graph.
I've opened another defect with the precise definition of the issue here. Thanks for this one!
Regarding the preservation of referential correctness things are getting complicate. :)
It is indeed quite a work to support it and most concerning part here is that it will certainly affect the performance of the processing of any case, even when object has a single parent, which is a vast majority of cases.
Beside that I've realized, that even if I can practically provide a referential correctness for the use-case you gave - same object appearing N times in the single ancestor's graph, it is almost impossible to provide the same functionality across the graphs. At least impossible without some serious memory concerns and/or touching the original object that is an input for an observation. I'd like to refrain from both of those.
From the other side, I think that in the contexts where object-observer
is applicable, having same objects duplicated more than once on the graph is very uncommon.
Bottom line: I'd like to postpone handling such a case and meanwhile only make it explicitly visible that cloning creates object duplication when same reference found more than once on the graph.
I'm currently trying to decide to throw an error when encountering such a case or write some warning to the log.
WDYT of all of this?
from object-observer.
Closing this issue due to quite a big change required while not yet proven strong requirement from the real-life usage, please re-open if any new considerations arose.
from object-observer.
I'm reopening this issue for a tracking and will attempt to look onto it again
from object-observer.
After a 'fresh' look onto the issue i'm again postponing to deal with it - the caveats are managing multiple parent contexts per observable which will definitely have a negative impact on performance and code complexity/maintanability.
Let me wait for a real need for this one, if any (there were no public signs of interest except this thread, purely tech one).
from object-observer.
Related Issues (20)
- Add TS definitions for convenience
- fix TS definition of Observable
- fix ChangeType type in TS definition
- the options should be optional on ObjectObserver's observe type definition
- Access the original object + some ideas HOT 6
- externalize `[un]observe` API - eliminate source modification
- Clean up the patching source code HOT 1
- Any way to prevent changes? HOT 2
- Exported CommonJS package HOT 15
- Request: Lite Version of Object Observer HOT 2
- Allow omission of observed keys and handling of cyclic references HOT 2
- handle correctly circular shaped object passed for observation HOT 3
- Wildcard path HOT 1
- Proxy only plain objects HOT 4
- Right-hand side of 'instanceof' is not an object HOT 5
- Can I copy the payload in the change handler? HOT 5
- pathsOf filter is misbehaving HOT 1
- Unable to get regexp from observable HOT 5
- Un-cure native objects unless proven needed HOT 1
- [ci/cd] remove custom CI logic in favor of standard npm version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from object-observer.