mirror of
https://github.com/penpot/penpot.git
synced 2025-07-21 22:27:24 +02:00
⬆️ Upgrade to beicon2 (part1)
This commit is contained in:
parent
ecee15af5b
commit
96f5a33f5f
151 changed files with 482 additions and 433 deletions
|
@ -7,7 +7,7 @@
|
|||
(ns app.util.cache
|
||||
(:require
|
||||
[app.util.time :as dt]
|
||||
[beicon.core :as rx]))
|
||||
[beicon.v2.core :as rx]))
|
||||
|
||||
(defonce cache (atom {}))
|
||||
(defonce pending (atom {}))
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
[app.util.globals :as globals]
|
||||
[app.util.time :as dt]
|
||||
[app.util.webapi :as wapi]
|
||||
[beicon.core :as rx]
|
||||
[beicon.v2.core :as rx]
|
||||
[cuerdas.core :as str]
|
||||
[promesa.core :as p]))
|
||||
|
||||
|
@ -58,7 +58,7 @@
|
|||
:or {mode :cors
|
||||
headers {}
|
||||
credentials "same-origin"}}]
|
||||
(rx/Observable.create
|
||||
(rx/create
|
||||
(fn [subscriber]
|
||||
(let [controller (js/AbortController.)
|
||||
signal (.-signal ^js controller)
|
||||
|
@ -172,7 +172,7 @@
|
|||
(p/create
|
||||
(fn [resolve reject]
|
||||
(->> (rx/take 1 observable)
|
||||
(rx/subs resolve reject)))))
|
||||
(rx/subs! resolve reject)))))
|
||||
|
||||
(defn fetch-data-uri
|
||||
([uri]
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
[app.util.browser-history :as bhistory]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.timers :as ts]
|
||||
[beicon.core :as rx]
|
||||
[beicon.v2.core :as rx]
|
||||
[goog.events :as e]
|
||||
[potok.core :as ptk]
|
||||
[potok.v2.core :as ptk]
|
||||
[reitit.core :as r]))
|
||||
|
||||
;; --- Router API
|
||||
|
@ -159,4 +159,4 @@
|
|||
(bhistory/disable! history)
|
||||
(e/unlistenByKey key)))))
|
||||
(rx/take-until stoper)
|
||||
(rx/subs #(on-change router %)))))))
|
||||
(rx/subs! #(on-change router %)))))))
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
(ns app.util.sse
|
||||
(:require
|
||||
["eventsource-parser/stream" :as sse]
|
||||
[beicon.core :as rx]))
|
||||
[beicon.v2.core :as rx]))
|
||||
|
||||
(defn create-stream
|
||||
[^js/ReadableStream stream]
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
[app.config :as cfg]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.storage :refer [storage]]
|
||||
[beicon.core :as rx]
|
||||
[beicon.v2.core :as rx]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(defonce theme (get @storage ::theme cfg/default-theme))
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
(ns app.util.timers
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[beicon.core :as rx]
|
||||
[beicon.v2.core :as rx]
|
||||
[promesa.core :as p]))
|
||||
|
||||
(defn schedule
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
[app.common.exceptions :as ex]
|
||||
[app.common.logging :as log]
|
||||
[app.util.object :as obj]
|
||||
[beicon.core :as rx]
|
||||
[beicon.v2.core :as rx]
|
||||
[cuerdas.core :as str]
|
||||
[promesa.core :as p]))
|
||||
|
||||
|
@ -247,7 +247,7 @@
|
|||
(fn [blob]
|
||||
(->> (read-file-as-data-url blob)
|
||||
(rx/catch (fn [err] (reject err)))
|
||||
(rx/subs (fn [result] (resolve result)))))))
|
||||
(rx/subs! (fn [result] (resolve result)))))))
|
||||
|
||||
(catch :default e (reject e))))))
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"A interface to webworkers exposed functionality."
|
||||
(:require
|
||||
[app.common.transit :as t]
|
||||
[beicon.core :as rx]
|
||||
[beicon.v2.core :as rx]
|
||||
[goog.events :as ev])
|
||||
(:import
|
||||
goog.net.WebSocket
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
[app.common.uuid :as uuid]
|
||||
[app.util.object :as obj]
|
||||
[app.worker.messages :as wm]
|
||||
[beicon.core :as rx]))
|
||||
[beicon.v2.core :as rx]))
|
||||
|
||||
(declare handle-response)
|
||||
(defrecord Worker [instance stream])
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
(:require
|
||||
["jszip" :as zip]
|
||||
[app.util.http :as http]
|
||||
[beicon.core :as rx]
|
||||
[beicon.v2.core :as rx]
|
||||
[promesa.core :as p]))
|
||||
|
||||
(defn compress-files
|
||||
|
@ -29,7 +29,7 @@
|
|||
:response-type :blob
|
||||
:method :get})
|
||||
(rx/map :body)
|
||||
(rx/flat-map zip/loadAsync)))
|
||||
(rx/merge-map zip/loadAsync)))
|
||||
|
||||
(defn- process-file
|
||||
[entry path type]
|
||||
|
@ -65,4 +65,4 @@
|
|||
(.forEach zip get-file)
|
||||
|
||||
(->> (rx/from (p/all @promises))
|
||||
(rx/flat-map identity))))
|
||||
(rx/merge-map identity))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue