I’m still fairly new to Meteor so I’m trying to understand some of the core principals; I understand that there may not yet be canonical ways of doing everything.
I’ve got a calendar composed of Day objects, each with a number of properties. The client interaction is somewhat involved, needing to repeatedly access and modify these properties. Is the ‘correct’ or best way to do this via a ReactiveDict plus a Template.autorun to manage the db updates?
For example, a Day might look like:
"2014-11-20":{
"JLKGZnfFkGvX9DHgz":{
"state":1,
"notes":"Only available after 9",
"timestamp":"Thu Mar 05 2015 13:46:50 GMT-0500 (EST)"
},
"Rkhs4cu7LzyejcTYa":{
"state":1,
"notes":"",
"timestamp":"Thu Mar 05 2015 13:46:50 GMT-0500 (EST)"
},
"selected":true
}
Each hash key is a user id. I need to do things like calculate how many users have what states for that day, change the state of the current user, etc…
I would imagine that a ReactiveDict would be good for this (as opposed to a bunch of individual ReactiveVars) and an autorun block that interfaces with the collection?
Or am I missing something basic?