Fork me on GitHub
#luminus
<
2019-02-28
>
niels13:02:29

Did I imagine it, or is there a new edition of "Web Development with Clojure" in the making, with more re-frame in it?

niels13:02:47

I sort of remember hearing it on a podcast

lepistane15:02:02

U didn't imagine it

jumar15:02:44

How can I write a conditional such equal to (if (or (not x) y I'm struggling to find the right combination of any and not. Maybe that's not supported?

jumar15:02:15

It's harder to replace this with nested ifs because I also have else clause

jumar07:03:03

@yogthos any insights? 🙂

yogthos14:03:51

I'm not entirely sure what the problem is 🙂 can you give a more detailed example of what you're trying to do

jumar15:03:06

This is one example I'd like to write with a single {% if any first? not second? ...

{% if first? %}
            <div> THE SAME THING</div>
          {% else %}
            {% if not second? %}
              <div> THE SAME THING</div>
            {% endif %}
          {% endif %}
              ...

yogthos01:03:09

ah ok, yeah selmer doesn't really provide support for that, I find it's usually better to massage data before you pass it to selmer

yogthos01:03:42

so for example you could do group-by and then do an if for each category in selmer

jumar07:03:41

Great, thanks for the response. I wasn't really sure what's possible and what not.

adc1723:02:12

Hey @yogthos I hope this is the correct place for this post. I really enjoyed your article on Component and Mount: https://yogthos.net/posts/2016-01-19-ContrastingComponentAndMount.html I'm interested to learn more on the ending: > we have to be more careful about how we structure the application as Mount is agnostic regarding the architecture. I want to make sure I'm careful with mount when using luminus. Can you point me to any guides with examples of how to use it well, or even better, to a project on github that uses it well? Thanks!

yogthos23:02:23

Hi yeah sure, the main idea is to keep IO at the edges of the app so that the business logic isn't dependent on external resources. For example, if you're using mount to manage a database connection, functions that use the connection should only handle reading and writing while any data massaging should be delegated.

yogthos23:02:05

As a concrete example, say you're authenticating a user when they log in. You'd have one function to load the user from the database, and a separate function to handle authentication. The authentication function should accept the user as data as opposed to pulling it directly from the database.

yogthos23:02:57

The key reason for creating such separation is to keep application code pure as much as possible to make it easier to test and reason about