Skip to content

Commit acb24cd

Browse files
author
Shafeeq Kunnakkadan and Srihari Sriraman
committed
Update README, providine more information on example app.
1 parent c9e738c commit acb24cd

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

README.md

+14-7
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,29 @@ swagger.json and perform HTTP calls to show, list, create and update resources.
1414
## Installation
1515
re-crud is (will be) on clojars: `[re-crud "0.1.0"]`
1616

17-
## Usage
17+
## Example app
18+
- There is a comprehensive example-app in this repo: [example-app](example-app/)
19+
- You can find a running instance of this app here: [demo](https://omnypay.github.io/re-crud/)
20+
- This uses a fairly minimal CRUD web service written in Rails, deployed here: [web app](https://re-crud-example.herokuapp.com/swagger/index.html)
1821

19-
The [example-app](example-app/) uses all features of `re-crud`.
22+
## Usage
2023

2124
Initialize `re-crud` soon after you initialize your re-frame app db.
2225
`re-crud.core/init` takes a map of `service-name`:`config` pairs.
2326

2427
```clojure
25-
{"re-crud-example" {:service-host "https://my-service.host"
26-
:swagger-url "https://my-service.host/swagger.json"
27-
:dispatch-on-ready [:on-ready]}}
28+
(require '[re-crud.core :as crud])
29+
(crud/init
30+
{"service-name" {:service-host "https://my-service.host"
31+
:swagger-url "https://my-service.host/swagger.json"
32+
:dispatch-on-ready [:on-ready]}})
2833
```
2934

30-
The event `dispatch-on-ready` event from service config is dispatched once `re-crud` has parsed the swagger spec for that service.
35+
The `dispatch-on-ready` event from service config is dispatched once `re-crud` has parsed the swagger spec for that service. Initialize your views after this event has been triggered.
3136

3237
Add [crud.css](css/crud.css) in your app for styling. `re-crud` comes with a skin that appies [MUI CSS](https://www.muicss.com/).
3338

34-
Use component-generators from `re-crud.components` to generate the view compnent and associated events.
39+
Use component-generators from `re-crud.components` to generate the view compnent and associated events.
3540

3641
A simple component to retrieve and display a resource would look like this.
3742

@@ -49,6 +54,8 @@ A simple component to retrieve and display a resource would look like this.
4954
- `:fetch` describes how to fetch the resource to show
5055
- `:view` configures UI details
5156

57+
TODO: add documentation around `:load-component`
58+
5259
Here's a slightly more involved example:
5360

5461
```clojure

0 commit comments

Comments
 (0)