React = require 'react' {ThreadStore} = require 'inbox-exports' module.exports = MessageSubjectItem = React.createClass displayName: 'MessageSubjectItem' getInitialState: -> @_getStateFromStores() componentDidMount: -> @_unsubscriber = ThreadStore.listen @_onChange componentWillUnmount: -> @_unsubscriber() if @_unsubscriber render: ->
{@state.thread?.subject}
_onChange: -> @setState(@_getStateFromStores()) _getStateFromStores: -> thread: ThreadStore.selectedThread()