More 2.7 data examples please

Hi Enyo Folks,
I'd find it really helpful to see more 2.7 examples using data. Are there any sample apps besides the moon-flickr that show source/model/collection best practices for 2.7? I find moon-flickr quite lacking because it doesn't show relations or persisting data.
I hoped I could wire up enyo to loopback using one of their sample apps, loopback-getting-started-intermediate as an exercise before getting started on my own app, but I find myself overwhelmed and keep getting hung up on little things when I try to pull together all the info in the Developer Guide and ENYODOCS. For instance, in, I am confused by the use of url and getUrl in the example model definition:
        name: "ContactModel",
        kind: "enyo.Model",
        options: {parse: true},
        source: "ajax",
        url: "",
        getUrl: function() {
            return "" + this.get("user_id");
        parse: function(data) {        // incoming data contains {status:..., result:...}
            return data.result;        // returned data contains {user_id:..., name:..., ...}
While in the ENYODOCS the Model getUrl entry states "Note that, if this method is implemented, the url will not be used." Is there a use for both methods in the example ContactModel above, or is one of them a leftover from an earlier version, or am I just misunderstanding that "Note"?
I'd love to see some more working examples of 2.7 fetching and committing data to get me over some current humps. I also wonder if Flux is 'here to stay' in Enyo and whether I should try to get up to speed with that pattern.
Lastly, will Roy be updating "Enyo Up and Running" for 2.7 and if so, will that go into Flux?


  • Hi! That url usage does seem to be a bit of a leftover. Maybe it was intended that getUrl would use this.url as the base? I don't know. Pull requests welcomed!

    Flux is still considered WIP. That said, we do use it internally and have had good success with it. It's safe to say that next generation Enyo will have a one-way data flow much closer to Flux than the current approach.

    I'm thinking about updating the book for 2.7. Just not sure where the time will come from... That said, I probably wouldn't dive deeply into the Flux pattern very much.
Sign In or Register to comment.