Skip to content
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

More Firebase like API #17

Open
dreampulse opened this issue Mar 12, 2014 · 0 comments
Open

More Firebase like API #17

dreampulse opened this issue Mar 12, 2014 · 0 comments

Comments

@dreampulse
Copy link
Owner

Using Getter/Setters:

var o = new Object();
o.defineSetter("foo", function(val) {foo=val;})
undefined
o.defineGetter("foo", function() {return foo;})
undefined
o
{ a: 'foo',
b: 'bar',
foo: [Getter/Setter] }

See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineGetter

Better Array Handling:

o.c = [1,23]
o.c.fn = function() {}

o
{ a: 'foo',
b: 'bar',
foo: [Getter/Setter],
c: [ 1, 23, fn: [Function] ] }

o.c.fn
[Function]
o.c.length
2

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

No branches or pull requests

2 participants