ducky/web

Paddy 2015-07-07 Parent:275a83e4c02e

21:bc1478742a50 Go to Latest

ducky/web/src/main.js

Implement subscriptions. Create a Subscription model and a Subscriptions collection, and attach them to the app context. Add a helper to our Profile model to retrieve the Subscription of that model. Still not sure this should be on the Profile--wouldn't it be better on the Me model? Isn't that generally where we would need it?

History
     1.1 --- a/src/main.js	Tue Jul 07 21:25:49 2015 -0400
     1.2 +++ b/src/main.js	Tue Jul 07 21:29:19 2015 -0400
     1.3 @@ -1,6 +1,7 @@
     1.4  import app from 'ampersand-app'
     1.5  import Router from './router'
     1.6  import Profiles from './models/profiles'
     1.7 +import Subscriptions from './models/subscriptions'
     1.8  import Me from './models/me'
     1.9  import normalize from 'normalize.css/normalize.css'
    1.10  import styles from './styles/main.scss'
    1.11 @@ -8,10 +9,11 @@
    1.12  window.app = app.extend({
    1.13    init () {
    1.14      this.profiles = new Profiles()
    1.15 +    this.subscriptions = new Subscriptions()
    1.16      this.me = new Me().load()
    1.17      this.me.on('change', this.me.debouncedWriteToCache)
    1.18      this.router = new Router()
    1.19 -    this.router.history.start({ pushState: true })
    1.20 +    this.router.history.start()
    1.21    }
    1.22  })
    1.23