re-frame/docs/API.md

40 lines
1.6 KiB
Markdown
Raw Normal View History

2017-07-20 15:14:07 +00:00
## The re-frame API
2017-07-23 03:09:38 +00:00
Orientation:
1. The re-frame API is provided by the [re-frame.core](/src/re_frame/core.cljc) namespace
2. Typically, you'll only use 4 to 10 of the API functions (small surface)
3. Oft-used API functions have doc strings, linked-to below (no auto-generated docs [because of this problem](/src/re_frame/core.cljc#L23-L36))
2017-07-20 15:01:51 +00:00
## Links To API docs
2017-07-23 03:09:38 +00:00
The core API is:
- [dispatch](/src/re_frame/router.cljc#L229-L239), [dispatch-sync](/src/re_frame/router.cljc#L247-L259). See also [this FAQ](/docs/FAQs/When-Does-Dispatch-Happen.md)
- [reg-event-db](/src/re_frame/core.cljc#L71-L80), [reg-event-fx](/src/re_frame/core.cljc#L87-L97)
- [reg-sub](/src/re_frame/subs.cljc#L151-L237)
- [subscribe](/src/re_frame/subs.cljc#L67-L83)
2017-07-23 03:09:38 +00:00
Occasionally, you'll need to use:
- [reg-fx]() XXX
- [reg-cofx]() XXX and [inject-cofx](src/re_frame/cofx.cljc#L22-L73)
2017-07-20 15:01:51 +00:00
2017-07-23 03:09:38 +00:00
And, finally, there are builtin Interceptors which are used a bit:
- [path](/src/re_frame/std_interceptors.cljc#L149-L173)
- [after](/src/re_frame/std_interceptors.cljc#L260-L281)
- [debug](/src/re_frame/std_interceptors.cljc#L13-L36)
2017-07-23 03:09:38 +00:00
- [and browse the others](/src/re_frame/std_interceptors.cljc)
2017-07-20 15:01:51 +00:00
Builtin effects:
XXX
Builtin coeffects:
XXX
Previous: [First Code Walk-Through](CodeWalkthrough.md)      
2017-07-20 15:01:51 +00:00
Up: [Index](README.md)      
Next: [Mental Model Omnibus](MentalModelOmnibus.md)
2017-07-20 15:01:51 +00:00
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- END doctoc generated TOC please keep comment here to allow auto update -->