Comments (5)
The thing that's fuzzy to me is if we should tear down the observations if something else is using it. Or if it would be possible for something else to be using that observation.
from can-observation.
The thing that's fuzzy to me is if we should tear down the observations if something else is using it. Or if it would be possible for something else to be using that observation.
I think it's extremely unlikely that something else is using the other observations but SHOULD NOT be torndown when the outer observation is re-calculated.
from can-observation.
The way this is implemented makes an assumption that any observations created within another observation will always be recreated whenever the parent observation is updated.
This is not always the case, for example when the child observation is cached. This is the case with can-stache, which caches observations it creates for perf reasons. See here
from can-observation.
I'm trying a slightly different approach than what is in #131. Instead of destroying all children whenever an observation is updated, will instead provide an API: trapBindings
that traps calls to can.onValue
. Pseudocode or how that will be used:
function fn() {
// priority 2
var foo = new Observation(function foo(){
var val = bar.get();
fooUpdates++;
return val;
}, {isObservable: false});
var stopTrap = foo.trapBindings()
Bindings.start()
view.live(foo);
ObservationRecorder.addBindings( stopTrap() )
return foo.get();
}
from can-observation.
We are going to defer doing this change (and removing can-view-nodelist) for now. I wrote up this gist which describes where I got with the task and what the next steps would be.
from can-observation.
Related Issues (20)
- Setup missing badges
- Support Async Observations HOT 3
- Add API for getting the value of an observation HOT 1
- An in-range update of can-reflect is breaking the build 🚨 HOT 2
- An in-range update of can-queues is breaking the build 🚨 HOT 1
- An in-range update of can-event-queue is breaking the build 🚨 HOT 1
- An in-range update of can-key-tree is breaking the build 🚨 HOT 1
- An in-range update of can-log is breaking the build 🚨 HOT 1
- An in-range update of can-observation-recorder is breaking the build 🚨 HOT 1
- An in-range update of can-cid is breaking the build 🚨 HOT 1
- An in-range update of can-event-queue is breaking the build 🚨 HOT 1
- updateChildrenAndSelf may throw when dereferencing observation.deriveQueue.isEnqueued HOT 1
- create deferred observation HOT 1
- Pull out "stack and updater" part of can-observation HOT 1
- reader should be able to read methods from strings / numbers / etc
- An in-range update of can-compute is breaking the build 🚨 HOT 3
- An in-range update of can-define is breaking the build 🚨 HOT 6
- An in-range update of can-event is breaking the build 🚨 HOT 2
- 3.3.0 removed reader.js HOT 3
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 can-observation.