           (when (or crossed-forward crossed-backward)
             (let [direction (if crossed-forward :forward :backward)]
               (.log js/console "Passed" id "going" direction)
-              (when callback (callback direction)))))))))
+              (when-let [callback (:callback @options)]
+                (callback direction)))))))))
 
 (defn waypoint-context [_]
   (let [state (atom {})

  (let [rect (.getBoundingClientRect node)]
    (+ (.-top rect) (.-pageYOffset js/window))))

(defn- make-reset-trigger-point [id]
  (fn [this]
    (swap! waypoints assoc-in
           [id :trigger-point]
           (get-element-top (reagent/dom-node this)))))

(defn waypoint [child-el options]
  (let [id (gensym "waypoint-id")
        reset-trigger-point! (make-reset-trigger-point id)]
    (reagent/create-class
     {:display-name "waypoint"

      :component-will-mount
      (fn []
        (swap! waypoints assoc id {:callback (:callback options)}))
      :component-will-unmount
      (fn []
        (swap! waypoints dissoc id))

      :component-did-update reset-trigger-point!

      :reagent-render
      (fn [child-el opts]
        (reset! options opts)
        child-el)})))

(defn- page-offset []
