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

Realm apis should follow JS Conventions #21

Closed
alazier opened this issue Sep 23, 2015 · 5 comments
Closed

Realm apis should follow JS Conventions #21

alazier opened this issue Sep 23, 2015 · 5 comments
Assignees

Comments

@alazier
Copy link
Contributor

alazier commented Sep 23, 2015

@appden :

I think it's best to follow JS conventions and use the Realm constructor as a namespace for the other ones (i.e. Realm.Type, Realm.Object, and a future Realm.Array). JavaScript devs will appreciate this and it'll make it easier to modularize with ES6 modules as well.

@appden feel free to suggest alternatives here.

@alazier
Copy link
Contributor Author

alazier commented Sep 28, 2015

@appden, would the Realm object be Realm.Realm or just Realm under this convention?

@alazier alazier self-assigned this Sep 28, 2015
@appden
Copy link
Contributor

appden commented Sep 28, 2015

It would be still just be Realm. This is kind of like jQuery where it's a constructor that also has static properties like jQuery.get(), etc.

@alazier
Copy link
Contributor Author

alazier commented Sep 29, 2015

So I changed RealmType to Realm.Type in #35 . Not sure what if anything we need to change for Object or List since users can't create these explicitly and can only get them from methods on existing objects. Would using the namespacing in our documentation be sufficient?

@appden
Copy link
Contributor

appden commented Sep 29, 2015

Maybe this is a good time to rename the type from Array to List. Also, it looks like we still create RealmObject as a global property even though it isn't useful. We should just remove it then, right?

@alazier
Copy link
Contributor Author

alazier commented Sep 29, 2015

We can remove the global RealmObject. Will add the List rename to the other pr.

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

No branches or pull requests

2 participants