Skip to content

Commit

Permalink
More fixes for EclipseStore
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsz committed Oct 6, 2024
1 parent 7455539 commit 7f9ada5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/system/components/eclipsestore.clj
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
component/Lifecycle
(start [component]
(let [storage-manager (EmbeddedStorage/start)
data (if (.root storage-manager)
(.root storage-manager)
{})
data-in-atom (atom data)]
(add-watch data-in-atom :watcher
(fn [key atom old-state new-state]
(.setRoot storage-manager new-state)
(.storeRoot storage-manager)))
(assoc component :db data-in-atom :storage-manager storage-manager)))
(stop [component]
root (if (.root storage-manager)
(.root storage-manager)
{})
data (atom root)]
(.setRoot storage-manager root)
(add-watch data :watcher
(fn [key atom old-state new-state]
(.storeRoot storage-manager)))
(assoc component :db data :storage-manager storage-manager)))
(stop [component]
(remove-watch (:db component) :watcher)
(.shutdown (:storage-manager component))
(dissoc component :db)))
(dissoc component :db :storage-manager)))

(defn new-eclipsestore [& {:keys []}]
(map->EclipseStore {}))

0 comments on commit 7f9ada5

Please sign in to comment.