Fork me on GitHub

i made a thing, not sure if it goes against some explicit decision in re-frame or not. it allows you to tee an event handler so that you can pipe it to multiple handlers


hi everybody. A problem with file uploading: - I have a form (in my views.cljs) with an input of type "file" - I have an upload button that should dispatch the file uploading event to the server via ajax I have an event on the on-change of the input "file" that fires this:

 (fn [db [_ _]]
   (let [input-element (.getElementById js/document "file")
         name (.-name input-element)
         files (.-files input-element)
         form-data (let [f-d (js/FormData. "file-form")]
                     (doseq [file-key (.keys js/Object files)]
                       (.append f-d name (aget files file-key)))
     (assoc-in db [:document-details :new-version :multipart] form-data))))
But form-data is always empty.


And the event the do the actual ajax calls sends nil to the server.


my bad, at further inspection form-data has a value in it. Just need not properly send it to the server now. 🙂