These are chat archives for riot/riot

7th
Aug 2015
Shane R. Spencer
@whardier
Aug 07 2015 03:47
any obvious method to make { varname } in templates automagically listen for changes to an observable without pointing it out in the tags script?
Tim Davis
@thebearingedge
Aug 07 2015 04:52
I was wondering the same and will probably try a mixin.
that's my current procedure.. love a comment and a smack on the head.
Tim Davis
@thebearingedge
Aug 07 2015 06:25
I recommend passing your new name values directly to a handler inside navbar. i.e. Subscribe to navigation observable within navbar, and call trigger(‘event_name’, singular, plural') within record, passing the name(s). The listener in navbar might look like:
navigation.on(‘update_content_section_name’, function (singular, plural) {
  self.content_section_name_singular = singular;
  self.update()
})
Does that make sense?
Shane R. Spencer
@whardier
Aug 07 2015 06:28
Sort of. So [0] in the return after a mount.
Tim Davis
@thebearingedge
Aug 07 2015 06:28
The idea is just avoiding extra globals
Shane R. Spencer
@whardier
Aug 07 2015 06:28
and put all those fun gibbly bits in the tag.
ah.. sorry but the globals need to stick around until I get in the swing of things.. they get used by lots of stuffs.
Tim Davis
@thebearingedge
Aug 07 2015 06:33
I see. Perhaps then the name globals could be properties on navigation and interested parties can get a reference to navigation. I mean, overall, can’t really recommend any changes to your implementation as long as it’s giving you the correct results. But more cohesion will help you make changes down the line without jumping around the project too much
This stuff is so fun!