luminus

niels 2019-02-28T13:23:29.000800Z

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

niels 2019-02-28T13:23:47.001100Z

I sort of remember hearing it on a podcast

lepistane 2019-02-28T15:01:02.001300Z

U didn't imagine it

jumar 2019-02-28T15:26:44.002300Z

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?

yogthos 2019-03-01T14:45:51.011200Z

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

jumar 2019-03-01T15:53:06.011400Z

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 %}
              ...

yogthos 2019-03-03T01:41:09.020900Z

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

yogthos 2019-03-03T01:41:42.021100Z

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

jumar 2019-03-03T07:36:41.021300Z

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

jumar 2019-02-28T15:28:15.002400Z

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

adc17 2019-02-28T23:28:12.005Z

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!

yogthos 2019-02-28T23:34:23.008Z

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.

yogthos 2019-02-28T23:37:05.009900Z

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.

yogthos 2019-02-28T23:37:57.010900Z

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