Iron is support for code for my ClojureScript projects; initially for Sodium
Sodium came first, and got its name from React, Soda-ash, and Semantic-UI. See its readme for the punny details.
Iron is intended to hold the shared parts used by Sodium and other related libraries,
which will have similar elemental names. Ium seemed like a good possibility. But since
the focus is on front-end code, fe-ium
. And, of course, FE is iron. So, there you go.
Iron is still a early work in progress. I am using it to help me with other projects and have only added functionality that I need and can test. Iron will only grow as it helps me (or other contributers) accomplish what they need. If you need features now, PRs are welcome.
If you want to contribute to this project, you will want to test your changes. You can extend the (very minimal) tests inside Sodium, but you will probably need to really test by using Sodium in a ClojureScript project. The easiest way to do this, while you are changing Iron, is by using Leiningen's checkouts directory feature by sym-linking directly to your copy of Sodium.
Iron is a library, with a grab-bag of functions for re-frame projects. You can use it in several ways:
These are some some of the functions that I've needed often in re-frame projects. I expect this will grow rapidly with time. PRs are welcome here, though I'm likely to be opinionated about what I accept.
negligible?
- Variant of empty? that behaves reasonably for non-seqs tooci-compare
,ci-sort
,ci-sort-by
, andci-includes?
- Case-insensitive string functionsvalidate
- Wrapper for Clojure specs checking in pre-conditions.vconcat
- Like concat, but returns a vector- "Camelize" functions - Convert Clojure-style names to JavaScript style
sub2
- Shorthand for a simple re-frame 'level-2' subscription (one that simply accesses the db)>evt
- Wrapper around re-frame/dispatch, with added sugar for defaults and coersions<sub
- Shorthand for re-frame subscribe and immediate derefevent->fn
- Allow re-frame events to be used in contexts that expect a functionsub->fn -
Allow re-frame subscriptions to be used in contexts that expect a functioncheck-and-throw
- Helper for spec-driven app-db validation.
Definitions for a few common Unicode characters.
lein doo phantom test auto
will run the (embarrasingly few) unit tests I've written so
far. More are needed. PRs especially welcome here.
- https://semantic-ui.com/
- https://react.semantic-ui.com/introduction
- https://github.com/Semantic-Org/Semantic-UI-React
- https://github.com/gadfly361/soda-ash
I can usually be found on the Clojurians Slack #reagent or #re-frame slack channels. My handle is @deg. Email is also fine.
Copyright © 2017-2018, David Goldfarb deg@degel.com
Licensed under the Eclipse Public License.