Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Support watching sub-expressions (JSON values) as is done for function parameters #16

Open
caitp opened this issue Jun 2, 2014 · 1 comment

Comments

@caitp
Copy link
Contributor

caitp commented Jun 2, 2014

Cross-referencing angular/angular.js#7663

Basically, we do this already for function paramters, it needs to happen for JSON values too.

In fact, if a JSON literal expression contains non-const expressions, then most likely we should exclusively be watching the subexpressions, and not the JSON object itself --- so that we don't end up replacing the whole object and creating garbage.

We already do this for PureFunctionAST (and I don't think this should be removed as cargo cult), so we ought to do it for JSON literal properties too. I can't recall if we're already doing that, but I don't believe we have tests for it. I'll check

@caitp
Copy link
Contributor Author

caitp commented Jun 2, 2014

This isn't exclusively about "Bind-once", there are other benefits to doing this. I know people keep saying things like "Bind-once won't be necessary in the future because of Object.observe", but frankly this is not true, and I can't keep re-iterating the reasons why it's not true, it makes my throat sore. So there are benefits for non-bindonce-usecases, and benefits for bind-once too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant