re-frame/docs/FAQs/Why-CLJC.md

31 lines
819 B
Markdown
Raw Normal View History

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table Of Contents
- [Question](#question)
- [Answer](#answer)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2016-08-29 13:06:41 +00:00
### Question
2016-08-29 12:57:35 +00:00
2016-08-29 13:06:41 +00:00
Why is re-frame implemented in `.cljc` files? Aren't ClojureScript
2016-08-29 12:57:35 +00:00
files meant to be `.cljs`?
2016-08-29 13:06:41 +00:00
### Answer
2016-08-29 12:57:35 +00:00
2016-08-29 13:49:00 +00:00
So tests can be run on both the JVM and the JS platforms,
2016-08-29 12:57:35 +00:00
re-frame's implementation is mostly in `.cljc` files.
The trailing `c` in `.cljc` stands for `common`.
2016-08-29 13:49:00 +00:00
Necessary interop for each platform can be found in
2016-08-29 12:57:35 +00:00
`interop.clj` (for the JVM) and `interop.cljs` (for JS).
See also: https://github.com/Day8/re-frame-test
***
2016-08-29 12:57:35 +00:00
Up: [FAQ Index](README.md)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;