Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roman01la/solid-cljs
ClojureScript bindings to SolidJS
https://github.com/roman01la/solid-cljs
Last synced: 2 days ago
JSON representation
ClojureScript bindings to SolidJS
- Host: GitHub
- URL: https://github.com/roman01la/solid-cljs
- Owner: roman01la
- License: epl-2.0
- Created: 2023-02-10T16:18:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-24T12:20:24.000Z (11 months ago)
- Last Synced: 2024-08-02T13:33:07.856Z (3 months ago)
- Language: Clojure
- Size: 19.5 KB
- Stars: 56
- Watchers: 6
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# solid-cljs
ClojureScript bindings to SolidJS_Early alpha, unstable and highly experimental_
## Installation
1. `yarn add solid-js --save-dev`
2. Use Clojure's Git deps## Example
solid-cljs wraps SolidJS API documented at [solidjs.com/docs/latest/api](https://www.solidjs.com/docs/latest/api)```clojure
(ns app.core
(:require [solid.core :as s :refer [$ defui]]))(defui app []
(let [n (s/signal 0)]
(s/effect
(println "n:" @n))
($ :div
($ :button {:on-click #(swap! n inc)} "+")
@n
($ :button {:on-click #(swap! n dec)} "-"))))(s/render ($ app) (js/document.getElementById "root"))
```## Playground
_source in [`src/app/core.cljs`](src/app/core.cljs)_
1. Install NPM deps `yarn`
2. Run local build `clojure -M -m shadow.cljs.devtools.cli watch app`
3. Go to [localhost:3000](htpp://localhost:3000)