Fork me on GitHub
#clojurescript
<
2020-07-12
>
sveri08:07:33

Is there something like an when-not-empty-let or a more generic when-predicate-let in cljs / clj?

Oliver George09:07:50

Idle musing. How close does this get you? ‘(when-let [x (seq y)] ...’

sveri09:07:45

Nice idea, but, in my case it's a string that may be string empty. So I need more of a when-not-str-blank. Sorry, should have said that before.

p-himik10:07:22

There's also not-empty to prevent turning any collection into a seq.

p-himik10:07:47

And it should work for strings just as well.

p-himik15:07:44

In order to use a CLJ constant in a CLJS file, I have to wrap it in a macro, right?

frozenlock16:07:17

I get WARNING: Use of undeclared Var goog.date/UtcDateTime starting at 1.10.741. Bug?

Roman Liutikov17:07:40

More like a deprecation on Google Closure Library's side

frozenlock17:07:17

What makes you think that? I checked the docs and it appears to still be there. https://google.github.io/closure-library/api/goog.date.UtcDateTime.html