This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-02-28
Channels
- # announcements (11)
- # babashka (66)
- # beginners (19)
- # calva (4)
- # clj-kondo (26)
- # cljsrn (33)
- # clojure (38)
- # clojure-australia (10)
- # clojure-dev (3)
- # clojurescript (18)
- # conjure (8)
- # data-science (2)
- # datahike (1)
- # datascript (5)
- # defnpodcast (3)
- # emacs (3)
- # events (2)
- # fulcro (17)
- # funcool (66)
- # girouette (28)
- # jobs-discuss (1)
- # lsp (33)
- # malli (1)
- # membrane (11)
- # off-topic (2)
- # practicalli (1)
- # re-frame (141)
- # rewrite-clj (6)
- # sci (1)
- # shadow-cljs (68)
- # sql (5)
- # startup-in-a-month (7)
- # vim (1)
- # xtdb (21)
@raspasov the problem was with keyExtractor. I was using random-uuid wehereas I had to use a key that won’t change for each item
However, even low resolution images are taking long to show in the first place
https://github.com/expo/react-native-fade-in-image (this lib solves a bunch of edge cases around images loading nicely)
Or you can use something like https://github.com/oblador/react-native-animatable (but you’d have to tinker more with it, but it’s more customizable)
For highest performance there’s this https://github.com/software-mansion/react-native-reanimated (esp the v2 version) but it’s harder to use from ClojureScript
I’m loading from aws cloudfront
which I think is a cached aws s3 bucket
@raspasov react-native-fade-in-image is awesome!
;needs to return a key as string :keyExtractor (fn [[_ idx]] (str idx)) If I put a comment there, I probably struggled with it, lol
Is there a way to know how much progress have been made in sending a multipart request?
I have the following re-frame handler that sends a multipart request:
(reg-event-fx
:upload-video
(fn [cofx [_ navigation]]
(let [body (js/FormData.)
file (clj->js {:uri (-> cofx :db :uri) :name "movie.mov" :type "video/quicktime"})
thumbnail (clj->js {:uri (-> cofx :db :thumbnail-uri) :name "thumbnail.png" :type "img/png"})]
(prn "file is" file)
(prn "uploader is " (-> cofx :db :_id))
(.append body "video" file)
(.append body "thumbnail" thumbnail)
(.append body "title" (-> cofx :db :video-name))
(.append body "uploader" (-> cofx :db :_id))
{:db (->
(assoc (:db cofx) :uploading-progress true)
(assoc :upload-error false))
:http-xhrio {:method :post
:uri (str server-uri "/api/upload-video")
:body body
:on-success [:upload-success navigation]
:on-failure [:upload-error navigation]
:format (json-request-format)
:response-format (raw-response-format) #_(edn/edn-response-format)}})))
it is sending a video and an image. I want to know how much progress has been made in the upload
I love shadow-cljs, will try this out first. re-natal was such a headache back in the day.
I’m adding a DateTimePicker into my app like so:
[:> DateTimePicker
{:testId :dateTimePicker
:value (Date. 1598051730000)
:mode :date
:is24Hour false
:display :default
}]
Give js/Date
a try.
According to the docs https://www.npmjs.com/package/@react-native-community/datetimepicker#rn--060 which use
new Date()
But I’m getting the following error: