forked from youiest/youiest-unionize
-
Notifications
You must be signed in to change notification settings - Fork 1
/
react_package.coffee
38 lines (34 loc) · 1005 Bytes
/
react_package.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@userId = 'wiber' unless Meteor.userId()
@FeedList = React.createClass
"getInitialState": ()->
{feeds: WI.findOne
"_id": userId}
"componentDidMount": ()->
self = @
Tracker.autorun ()->
feed = WI.findOne({"_id": userId})
self.setState({"feeds": feed})
"render": ()->
feedsList = []
# console.log(this.state.feeds)
if(this.state.feeds and this.state.feeds.outbox)
outbox = this.state.feeds.outbox
feedsList = outbox.map (feed)->
# console.log(feed)
# React.DOM.div(null,"Something is returned")
Feed({"feed": feed})
# console.error(feedsList)
return React.DOM.div(null,"",feedsList)
@Feed = React.createClass({
"render": ()->
# console.error(this.props.feed)
feed = this.props.feed
React.DOM.div(null,{},
feed.from
# [
# React.DOM.div(null,{},feed.from),
# React.DOM.div(null,{},feed.to)
# ]
)
# React.DOM.div(null,"Something is returning")
})