This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Hi All, Is there a CLJS library to humanize numbers? Something like django.contrib.humanize or HubSpot/humanize. I'm mostly interested in natural numbers and plurals.
hi all, when using reagent (actually re-frame), what do you use for cross-browser widgets like draggable divs, flash messages, date input dialogs etc. Do you jquery-ui, roll your own with inspiration from https://github.com/reagent-project/reagent-cookbook/ or the google closure?
@colin.yates: re-com provides some basic widgets that interface nicely with re-frame
@zoldar: I know, but they are Chrome only
@zoldar: they are nice though :0
@colin.yates: well, then I'm joining the question. There are a couple bootstrap wrappers spread around the net but mostly abandoned and/or out of date afaik
colin.yates: when I need some ui control I would usually search first for a react component and wrap it..
@colin.yates, @michaelr: yeah, that's an option but it would be nice to have a consistent library of widgets, like om-bootstrap
acron: i dono about "any networked application".. there are many different cases, you know
@michaelr: I'm speculating but I doubt sente adds any provision for ordering messages and I'm fairly sure it's not done at the websocket. Definitely not at the transport layer.
I realise it's a broad statement, but my advise is just to never assume you're going to get messages in order.
hey guys, anyone every play around with clojure on coils? - https://github.com/zubairq/coils any thoughts?
@olivergeorge: use the built in cljs.pprint
@olivergeorge: not sure of the best docs for it, but this is a good starting point: https://clojuredocs.org/clojure.pprint/cl-format. Cljs version is mostly equivalent to clj
@zoldar: I'm currently "wrapping" a number of Semantic UI components using Rum. My impressions are that it is very difficult to create a reusable and universal component, because there are no "standard web widgets": every component needs to have slightly different behavior. I ended up having components like "input+button", but they tend to grow over time, as I add more and more options for customization.
@jrychter: btw, I've stumbled upon an attempt to adapt om-bootstrap to rum https://github.com/pleasetrythisathome/blackstrap/ . However, seems like the author ported only a part of them (the ones he needed probably)
@zoldar: I am not that desperate looking for libraries, because as it turned out, wrapping Semantic UI components using Rum isn't that bad or hard.
@michaelr: Well, if you want the js dependent stuff, but don’t want to include jQuery/etc.
andrewmcveigh: i think you have to include jQuery anyway for the bootstrap js stuff to work.. you mean it wraps the js bootstrap stuff I guess
@zoldar: No, I don't think so, it wouldn't make sense: they are too app-specific. And I'm not sure if universal ones can really be made. Perhaps with a behavior mixin architecture.
@michaelr: Really? I thought it was an implementation of bootstrap components using OM.
Could be wrong…
@jrychter: semantic ui looks really nice. and it seems to be less markup-heavy than bootstrap
Didn’t ever use it because it didn’t have a datepicker
@zoldar: I use it because it gets you up and running in no time with a rich collection of components. The semantic markup fits very nicely with sablono/hiccup-style coding. But it isn't ideal: it's JavaScript is something I try to avoid as much as I can.
Also, 500kB of CSS, as nobody seems to have invented a CSS whole-program optimizer yet.
@jrychter: right, fonts are embedded in the css, that may account for a sizable chunk of the total size
How should I set the browser URL to trigger my secretary routes using ClojureScript?
@petrus: What do you mean by set?
I want to change the URL in the address bar from a re-frame event, not an anchor click.
specifically, I want to change the URL token to match the route that I am sending the user to
I think you can do something with js/history.replaceState, but it’s limited
@petrus: in js you can do something like history.replaceState('Object', 'location', '/test’)
You’d likely have to re-call your routing after that.
where does nav-history come from?
btw, there is this blog post in my 'to read' list, looks pretty comprehensive http://www.lispcast.com/mastering-client-side-routing-with-secretary-and-goog-history
The other day someone (not sure who) asked about using apply
with console.log
. (.apply js/console.log js/console args)
works.
@bostonou: https://clojurians.slack.com/archives/clojurescript/p1435114591009892
Full code turned out to be:
(defn my-log
[& args]
(.apply js/console.log js/console (into-array args))
tired of writing the same clj-http/cljs-https boilerplate? want an easy way to express the notion of talking to an endpoint or a service? check out remote: https://github.com/outpace/remote
If I am making a function that takes a map and destructures by keys, is there a way to *require certain keys to exist in the map?
(defn picky [{:keys [must-have]}]
{:pre [must-have]}
(println "Everything is fine"))
Or use schema or typed clojure
(picky {:do-not-have :it}) ;; assert failed