This project is read-only.
1

Resolved

Add ability to computed properties automatically calculate dependencies.

description

I think that it should be handy for users to not enter dependencies every time because they shouldn't specify extra information that we can calculate by ourself.

For instance this code:
var Controller = Lava.Object({
            first: 'John',
            last: 'Doe',
            fullName: Lava.Computed('first,last', function () {
                return 'Hello, ' + this.first + ' ' + this.last + '!';
            })
        });
can be replaced with:
var Controller = Lava.Object({
            first: 'John',
            last: 'Doe',
            fullName: Lava.Computed(function () {
                return 'Hello, ' + this.first + ' ' + this.last + '!';
            })
        });
Actually I've made it locally but Im not familiar with TFS and codeplex workflow. I don't know how to commit it right)) Mostly I work with git system.

comments

tjscience wrote Aug 8, 2013 at 4:55 PM

I really like this change. Unfortunately, I have made some major changes to Lava so we will have to re-implement your changes once I commit mine. I will be committing my changes very soon. A huge part of the changes have to do with making templating and binding easier.

serge_zp wrote Aug 9, 2013 at 6:46 AM

Ok, I can reimplement it, just tell me when you will finish. I don't see any task that I can take to do, all of them are in process.

wrote Aug 9, 2013 at 2:43 PM

Please re-implement the auto-dependency functionality in the new codebase.  Please note that the codebase is VERY different now.

serge_zp wrote Aug 11, 2013 at 5:16 PM

I've changed 'dependencies' to optional parameter of computed property constructor. In simple case we shouldn't pass this parameter but if we want we can use some sophisticated 'dependency path'.
For instance we can use: 'xxxx.yyyy[@each].zzzzz' I didn't remove this parameter completely because I guess 'dependency path' syntax can grow fast.

wrote Aug 11, 2013 at 5:18 PM

wrote Nov 28 at 8:14 AM