todo-redux-saga icon indicating copy to clipboard operation
todo-redux-saga copied to clipboard

firebase classes for more complex data structures

Open mvanlonden opened this issue 8 years ago • 0 comments

Hey @r-park love this example. I've applied this example's logic to a more complex firebase structure with denormalized entries.

How would you recommend building a firebase model that can support lists of objects like this?

{
  "some-list" : {
    "-KbgyM0uO2l9oHCDwzAq" : {
      "prop" : "great",
      "some-ids" : {
        "-KbgyM-bzdBprmzIePhp" : true,
        "-KbwQ_AiyQcagPHnoEeI" : true
      },
      "other-ids" : {
        "again" : true,
        "nice" : true,
        "try" : true,
        "word" : true
      }
    },
    "-KbhA_tJ9ZyqQVzwHwWT" : {
      "item" : "fun",
      "some-ids" : {
        "-KbhA_sCvTVPBaFBRYcL" : true,
        "-KbwIevJI96eLSBP9h3b" : true
      },
      "other-ids" : {
        "again" : true,
        "new" : true,
        "nice" : true,
        "try" : true
      }
    }
  }
}

The existing firebase-list works really well for a list of simple objects, but is a little clunky for lists with other simple lists nested inside. Maybe some sort of composable model structure? I've also looked at firebase-saga which takes a more functional approach, although, I like being able to set the class properties in the watchers.

I'm a little torn on how to proceed. What do you recommend for more complex, denormalized structures?

mvanlonden avatar Feb 02 '17 06:02 mvanlonden