Comments (3)
Hi, thanks for a thanks and... really sorry for the delay.
Regardless of either you solved that or moved on, i'll take a look on this and see what's going on - today.
Will update here ASAP.
from object-observer.
Okay, I see what's going on.
Observation
The issue indeed with understanding of how the library works.
selectedAsset
is a native JS object.
You then creating filemanagerObserver
from it - i'd actually stick to the name filemanagerObservable
, which is closer to the design and really descripts things:
- in itself it is not observer, but it is able to be observed - and thus you are indeed doing an
.observe
call on it - we are deprated from the original
selectedAsset
, which is not observable but remained a simple pure object
Now, if you'd like to track a changes, you need to:
- make the changes on the
filemanagerObservable
and not on the original object (selectedAsset
) - you should NOT reassign the variable as a whole, like you do to the
selectedAsset
, since from that point you are loosing the reference to your object and getting a completely other one instead
Suggestion
Assuming, that I grasp correctly your intention here i suggest you to do the following:
- export the
observable
object returned fromObservable.from
API instead ofselectedAsset
- perform the changes on the
observable
's properties and any-deeper but NOT on the reference self- NOT GOOD:
observableSelectedAsset
= { } - GOOD:
observableSelectedAsset.filename = 'something'
- GOOD: for a 'bulk' assign like the one that you show in your
handleSelection
method you can useObject.assign(observableSelectedAssets, { whatever })
- NOT GOOD:
Please, notify me if the said above makes sense and / or there is still something to clarify / help you with.
from object-observer.
Closing due to non-activity, please review my answer before reopening and if not sufficient - welcome to reopen again!!!
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.