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

21 lines
522 B
Markdown
Raw Normal View History

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 13:06:41 +00:00
---
2016-08-29 12:57:35 +00:00
Up: [FAQ Index](README.md)