Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
clyfe authored Dec 26, 2023
1 parent 52be198 commit a701590
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ For a more complete example see [this test](test/clara_eav/rules_test.cljc).
(:require [clara.rules :as r]
[clara-eav.rules :as er]))

(er/defquery todo-q [?e]
[?todo <- er/entity :from [[?e]]])
(er/defquery done-q [?e]
[?todo <- er/entity :from [[?e :todo/done true]]])

(er/defsession session 'my.sample)

(-> session
(er/upsert #:todo{:eav/eid :new, :text "...", :done false})
(er/upsert #:todo{:eav/eid :new, :text "...", :done true})
(r/fire-rules)
(r/query todo-q :?e :new))
(r/query done-q :?e :new))

; ({:?e :new, :?todo #:todo{:eav/eid :new, :text "...", :done false}})
;; ({:?e :new, :?todo {:eav/eid :new, :todo/text "...", :todo/done true}})
```

## Guide
Expand Down

0 comments on commit a701590

Please sign in to comment.