Fork me on GitHub
#clojurescript
<
2022-06-19
>
Patrick Brown00:06:37

Is there a requiring-resolve workaround in cljs?

thheller06:06:39

which part do you mean? there is no dynamic require but there is resolve. can't have dynamic require outside the REPL or a self-hosted build though.

popeye07:06:36

I have seen in one of the doc , the way button is defined as [:button.btn.btn--link.tooltip] , what is the use of -- in this

p-himik07:06:56

It's just a part of the class name, btn--link.

popeye07:06:35

so it could be btn.link also ?

p-himik07:06:10

Well, that would be two classes then, btn and link. If you need to have a dot as a part of a class name, you can't use that shorthand - instead, you'd use the :class property.

p-himik07:06:16

Or if you mean that you can write btn.link instead of btn.btn--link - well, if you're the author of the relevant CSS and if you don't have any DOM queries that rely on btn--link, then sure. But it would also have to be a very careful decision from a design standpoint. btn--link is very clearly for a button whereas link is who knows for what. Given that you can mix multiple CSS classes, going with plain link might make some things much harder.

1
🙌 1
thheller09:06:12

there are several naming patterns for CSS. this looks like BEM, see http://getbem.com/naming/

🙌 1
popeye14:06:33

what is the use :> symbol in clojurescript? where can I find doc for this?

p-himik14:06:47

Most likely, you're using Reagent. The symbol itself is nothing special in CLJS, but Reagent treats it as a special component where the second argument is a native component. Documented somewhere in the Reagent's repo.

borkdude20:06:00

Someone here have a working example of memfn in CLJS?

borkdude20:06:04

got it:

((memfn startsWith prefix) "abc" "a")