PulsarBlow / aurelia-firebase

🔥 A Firebase plugin for Aurelia
https://aureliaonfire.azurewebsites.net
MIT License
23 stars 6 forks source link

Expose Firebase or Firebase.ServerValue #2

Open RainerAtSpirit opened 8 years ago

RainerAtSpirit commented 8 years ago

Wondering if it would make sense to either expose Firebase or Firebase.ServerValue through the plugin.

One use case would be to get a unique timestamp instead of relying on moment in application.

https://github.com/PulsarBlow/aureliaonfire/blob/c33b6bb0bda8db7f2fb21db28d6e50e94a7b974d/src/collections/todo.js#L26

https://www.firebase.com/docs/web/api/servervalue/timestamp.html

PulsarBlow commented 8 years ago

You're right, using moment at this place is kinda useless. I could use Math.floor(Date.now() / 1000) to get my timestamp without relying on moment.

Didn't know about Firebase.ServerValue.TIMESTAMP. Looks interesting as someone could change his computer time to highjack a date.