-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from denistakeda/fix/get-connection-back
fix(db): revert `connect!` fuction
- Loading branch information
Showing
6 changed files
with
29 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
(defproject re-posh "0.2.0" | ||
(defproject re-posh "0.3.0" | ||
:description "Use your re-frame with DataScript as a data storage" | ||
:url "https://github.com/denistakeda/re-posh" | ||
:license {:name "MIT" | ||
:url "https://opensource.org/licenses/MIT"} | ||
:dependencies [[org.clojure/clojure "1.9.0"] | ||
[datascript "0.16.6"] | ||
[re-frame "0.10.5"] | ||
[posh "0.5.5"]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
(ns re-posh.db | ||
(:require | ||
[posh.reagent :as p] | ||
[datascript.core :as datascript])) | ||
[posh.reagent :as p])) | ||
|
||
;; Basic store. This atom stores another atom | ||
;; @store - datascript connection | ||
;; @@store - datascript database | ||
(def store (atom nil)) | ||
|
||
(defn- connect! [] | ||
(defn connect! [conn] | ||
"Connect DataScript store to the re-frame event system" | ||
(let [conn (datascript/create-conn)] | ||
(p/posh! conn) | ||
(reset! store conn))) | ||
|
||
(connect!) | ||
(p/posh! conn) | ||
(reset! store conn)) |