     streams.localSlideStateChangeStream.onNext(
       new core.StateChange(
         event: ev, prevState: prevState, newState: newState))
-    CURRENT_LOCAL_SLIDE_STATE = newState
+    setSlideState(newState)
     newState
   catch err
     net.log(err) #TODO: replace this with an error record

  window.mainSlideDeck = deck = revealjsDomToSlideDeck()
  initSlide = deck.get(Reveal.getIndices())
  initState = new core.PresentationState(deck, initSlide)
  CURRENT_LOCAL_SLIDE_STATE = initState
  initState

initEventstreamSubscriptions = ->

utils = require "./utils"

CURRENT_LOCAL_SLIDE_STATE = null
setSlideState = (state) ->
  CURRENT_LOCAL_SLIDE_STATE = state
exports.getCurrentState = () -> CURRENT_LOCAL_SLIDE_STATE

################################################################################

