Comments (2)
Something like this?
;; helper
(defn channel->atom [ch atom]
(go (reset! state (<! ch)))
(defonce view-atom (atom :empty))
(defcard view-channel view-atom)
(channel->atom (config/read-config-from-url config-file-url) view-atom)
from devcards.
Yes, that works nicely. This is what I came up with, for reference:
(defn channel->atom
"Allows showing the first channel result in a devcard:
(defcard foo
(channel->atom (go :hello)))"
[channel]
(let [atom (reagent/atom :empty)]
(go (reset! atom (<! channel)))
atom))
from devcards.
Related Issues (20)
- How to render devcards into a HTML element other than #com-rigsomelight-devcards-main? HOT 6
- defcard-rg without a name causes compilation error HOT 2
- Document way of forcing a re-render HOT 1
- Feature: render small preview on the devcards overview page
- Devcards 0.2.6 doesn't work with shadow-cljs HOT 5
- Compile warning: var devcards.core/test-doc is not public HOT 3
- Updating react and react-dom versions for react hooks compatibility
- feature request: Integration with React Native Web
- multiple parameters to devcard
- strip off last namespace
- devcards not updating when changed. HOT 1
- Warning: componentWillMount has been renamed
- [Feature request]: `<details>` support
- Require react directly HOT 4
- Doesn't work with cider-jack-in
- Devcards not reloading when using code splitting
- The required namespace "devcards-marked" is not available, it was required by "devcards/util/markdown.cljs". HOT 10
- Error: create-react-class could not find the React object.
- Is there a way to massage the state in history mode?
- `lein new devcards` not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devcards.