Conversation
|
After some consideration, I don't think it probably makes sense to port the existing paradigm for Polymer({
is: "app-user",
mixins: [PolymerFire({
base: "https://example.firebaseio.com/users",
properties: ["name", "email"],
locationProperty: "id"
})],
properties: {name: String, email: String},
created: function(){ this.bindRef() }
});Where the mixin is a factory that takes the properties to bind as well as a property that can serve as a dynamic location identifier. I'll probably build this regardless of the direction of |
|
As promised, I couldn't resist building out a prototype of my suggestion above: https://github.com/divshot/polymerfire I think this is probably a more idiomatic way to approach Firebase data in a Polymer 0.8 world (without Object.observe it seems almost impossible to have a "zero JS" way to bind). |
This is incomplete work toward 0.8 compatibility for
firebase-element. I'm submitting it as a pull request to start discussion about some of the things that may need to change.Presently
demos/firebase.htmlwill load data but doesn't persist it -- at all. I think I may not understand how Polymer 0.8 property binding works when trying to use standard<form>elements, so any insight would be appreciated.I also ended up needing to load observe.js separately since I don't think it's part of Polymer anymore. Since 0.8 is moving away from Object.observe, should another solution be used in its place for firebase-element?
In any case, WIP feel free to poke around.