Comments (6)
sounds sensible
how about if you use .data()
inside constructor: ->
it is considered structural, and anywhere else it's referential?
from meteor-blaze-components.
I do not think that having different semantics based on where you call a function is a good API.
from meteor-blaze-components.
could have the default behaviour as referential, and a parameter for setting as structural
.data({structural:true})
from meteor-blaze-components.
I think we should leave default behavior as it is in Blaze. Just to minimize surprises. Default Blaze behavior is the most conservative one, it means functions/methods are rerun more often, but then Blaze does not necessary really modify DOM if everything stays the same. So this is a good default. It does not introduce any errors.
from meteor-blaze-components.
In fact, because I have not seen really non-object data contexts in practice, this means that the whole Blaze behavior is more similar to React.js: rerun everything and then compare with DOM and patch it if there are changes. The issue is that React.js uses virtual DOM do make comparison, while Blaze I think compare with real DOM. And reading real DOM is a bit slower than virtual DOM.
from meteor-blaze-components.
I think now that we have computed fields this is not really necessary. If you need different equality you can do:
onCreated: ->
@dataStructural = new ComputedField (=> @data()), EJSON.equals
And this is it. :-) And then you can call @dataStructural()
to get data context which will trigger reactive change only when data is structurally different.
For referential equality:
onCreated: ->
@dataReferential = new ComputedField (=> @data()), (a, b) => a is b
from meteor-blaze-components.
Related Issues (20)
- Example of mixin for two-way binding HOT 3
- TemplateTwoWayBinding HOT 3
- Template2
- How do you guys do Modals? HOT 8
- [Question] Best way to create a documentation about components HOT 23
- Ideas for new features of Blaze Components HOT 9
- [Question] Migrating to Blaze once the npm version is released. HOT 1
- Write template HTML within component JS? HOT 2
- How to unit-test a component? Guidance needed HOT 5
- Values is not defined HOT 2
- General Question HOT 1
- Interfacing with react.js HOT 6
- In-line component creation for lack of method params HOT 3
- What projects besides weekan are built with this library HOT 3
- Performance HOT 1
- Template Strings ? HOT 1
- Support coffeescript 2 (in Meteor 1.6.1) HOT 8
- Migrating to react: Rendering of BlazeComponents via React is NOT possible HOT 2
- error updating to Blaze Components 0.23 & Meteor 1.8.2-rc.3 HOT 3
- Meteor 1.8.2: ReferenceError: meteorBabelHelpers is not defined HOT 16
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 meteor-blaze-components.