These are chat archives for jdubray/sam

13th
Nov 2016
Fred Daoud
@foxdonut
Nov 13 2016 03:01
@devinivy there is a separate model for each instance of the same component. There is still a single root model; the separate models are nested within the root model. The component does not need to know anything about where it is nested.
Two instances of the random-gif component.
The model would look something like this:
{
  "randomGif1": {
    "isLoading": false,
    "isError": false,
    "tag": "cat",
    "image_url": "http://media3.giphy.com/media/JIX9t2j0ZTN9S/giphy.gif"
  },
  "randomGif2": {
    "isLoading": false,
    "isError": false,
    "tag": "test",
    "image_url": ""
  },
  "otherProperties": "etc"
}
But the model for the random-gif component only needs to concern itself with its own properties: https://github.com/foxdonut/meiosis-examples/blob/master/examples/random-gif/src/random-gif/model.js
It is the nestComponent that takes care of wrapping/decorating the component config to nest the component within the root model.
devin ivy
@devinivy
Nov 13 2016 16:35
this actually isn't dissimilar to $scope in angular, which does a more complicated type of nesting