-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename usage of "observable" to not confuse with TC39 observable #470
Comments
Perhaps just |
Yep good point, |
I like |
I also think that |
"trackables", |
Alternatively: |
I still like trackables |
Track, watch, listen, subscribe, spy, guard, audit, peek, glue, monitor, hunt, crib, hook, stick, chase. |
Hmm.. should |
Tracker. Reactive is a higher level concept. |
I like |
+1 |
All those words are so generic and used in so many different libraries and contexts. Use the words that best describe what's happening and introduce namespacing if neccessary. I am not a fan of "track", I feel like there is a subtle difference in the meaning, which doesn't fit into MobX context as good as "observe". "Listener" is in fact quite similar to "observer", but "listenable" doesn't sound right and listeners are already widely used in the context of event programming. "Watcher" is quite fine, but "watchable" only if it's enjoybale for watcher :) ...so I don't know about that either. |
You've just accidentally introduced a new candidate: @Detect (for Am Montag, 22. August 2016 schrieb urugator :
|
@winterbe @Detect is confusing because it can be used for observer, observer detects the changes of observable... What about: EDIT: when I think about it, @observer is only used on react components and in fact it's just autorun for component's render method, so... maybe @autorender or @autoupdate (react also uses the term "update")? |
I just found out this issue #169 and I am a little bit confused. |
@urugator there is a difference between having interoperability with TC39 observables and being TC39 observables. For example suppose you create the following So the only thing that could safely be implemented is |
@mweststrate I got the point, but I don't think that arguments are entirely valid: Handling primitives: Handling structures: Handling object properties: Only difference is the ability to observe specific property of observable object, which is something I would call a "parametrized subscription": Even though we could call property What's more If there is a concern that I don't say that mobx.observable should implement Observable API, I just don't see incompatibilities, which would make it impossible. |
@urugator hmm these are very interesting points indeed. Would it be confusing if an |
@mweststrate Yea, the question is, what should be produced by observable for it's subscriber... the changed value (which is actually observable itself) or change event? My additional thoughts/opinions:
Provide:
Provide:
(Similary, anyone can easily implement decorator passing just changed value instead of ChangeEvent) Provide:
Refactor: |
Although I understand that some confusion might arise from using a similar term to the tc39 proposal, I think will cause to much confusion to rename the whole concept at this point. Especially since in practice this doesn't seem to lead to trouble very frequently. I usually explain it as: there are observable streams which emit events to which one can subscribe, like RxJs, and there are observable values from which we can observe the updates (MobX). For the interoperability question, see #677 |
As many of you are aware of, TC39 (the standards body around the JavaScript language) have a proposal for adding a new async primitive to the language called an "Observable". The current iteration of the spec has a ton of history outside of JavaScript, but tl;dr is most recently inspired by the RxJS library, which now is also updated as one unofficial reference implementation.
The usage of the term "observable" in regards to the TC39 proposal is incompatible with the usage by MobX, which means if TC39 does in fact ever include it in JavaScript it's probably highly confusing to use the term in this fashion.
Aside from future hypothetical awkwardness, historically I would argue a majority of people who have heard the term associate it with either RxJS/Bacon/Most/or one of the other Reactive Extensions (Rx) implementations in other languages like Rx.NET, RxJava, etc. I feel like this may produce unnecessary confusion for adopters, especially if they wish to continue also using a library that implements their known definition of Observables, like RxJS, together with MobX.
I'd like to discuss possible alternative names MobX could adopt, if the MobX community is willing. I realize for some this is a non-trivial name change requiring a major version bump, but I believe it's best for the longevity of MobX.
FWIW MobX has a ton of overlapping functionality with Ember, which does not use the term Observable. Instead, they too use the terms computed properties and observers, but their computed properties also support writing/setting in a similar fashion of what MobX's
@observable
does.Thoughts?
(for reference: Mobx vs Reactive Stream Libraries (RxJS, Bacon, etc))
Cc/ @Blesh
The text was updated successfully, but these errors were encountered: