     @_asyncStatus = LOADING
     @emit('load')
 
-  loaded: (list) ->
-    @_courses = list
+  reset: ->
+    @_course_ids = []
+    CourseActions.reset()
+    @_asyncStatus = null
+    @emitChange()
+
+  loaded: (courses) ->
+    @_course_ids = _.map courses, (course) ->
+      CourseActions.loaded(course, course.id)
+      course.id # Store only the ids
     @_asyncStatus = LOADED
     @emit('loaded')
 

        true

    allCourses: ->
      return @_courses

    get: (id) ->
      _.findWhere(@_courses, {id: id})

module.exports = {CourseListingActions, CourseListingStore}

CourseListingActions = flux.createActions [
  'load'
  'loaded'
  'reset'
]

CourseListingStore = flux.createStore
