Skip to content

Instantly share code, notes, and snippets.

@hodonsky
Created May 18, 2015 15:45
Show Gist options
  • Save hodonsky/9ee78918e87de4ffeef2 to your computer and use it in GitHub Desktop.
Save hodonsky/9ee78918e87de4ffeef2 to your computer and use it in GitHub Desktop.
State Model
{
app:{
version: "0.1.0",
state:{
currentRoute: "/search",
qs: "blah=derp"
// or
qs:{
blah:"derp"
}
data:{
browse:{
topId:"8&KJHAWIB7H/FBLH@H20%BL"
},
search:{
topId:"",
tags:"blah,derp,derpy"
},
// My Posts
storage:{
postIds:"23x632,234y4hSDFHLe,z3903uiHfelh2138ytali"
},
interested:{
postIds:""
},
conversations:{
// 'My' Id is 'A1'
ids:"A7,B2,C3,D4,C2",
lastOpenId:"C2",
// will always be from lastOpenId
messages:[
{id:"C2", message:"stuff"},
{id:"A1", message:"oh yeah... stuff?"},
{id:"A1", message:"got yourself a deal"}
]
},
onboarding:{
step:"1|2|3|complete"
},
// Not sure about all this yet
transactions:{},
bank:{
accounts:{
venmo:{
available: true,
approved:true,
fundsIn:9.09,
attachedBank: true
},
payPal:{
available:false,
approved:false,
fundsIn:0.00,
attachedBank:false
}
},
// This will be the amount of spending power they have through our Venmo account
localFunds:{
amount:16.27,
history:[]
},
escrow:{
items:["X15%$S","2B"],
funds:254.99
}
}
accountSettings:{
settings:{
}
}
}
}
}
meta:{
dataSource:"[redis|postgres]",
expected: null, //format or data
dateOfPush: null
},
referrer:{
type:null,
url:null,
format:null
},
// Toast usually, maybe inline some times
messages:{
from:null,
type:null,
content:null,
destination:null
}
}
//last active view of model is held
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment