It seems a little crazy to think about an application as just a reflection of the data, but I believe it is actually true. I've been building front-end browser applications for a long time, but it wasn't until I started getting into Clojure and ClojureScript (which was pretty recently) that the lightbulb went off for me.
0 Comments
Update: It turns out this no-refresh Hot-reload functionality is possible in both Angular and React JavaScript world! Scroll to the bottom for more information. Let me preface this post by saying that I'm really not a ClojureScript developer (nor am I really even a Clojure developer). I've gone through a few episodes where I looked at Clojure, but I always deemed it as too crazy to actually be a viable programming language... until recently. There's something especially magical about Clojure's hot reload that makes it better than other hot reload tools; actually, two things:
This may not seem like much, but if you are familiar with the current state of "hot reload" tools for Angular, React, or just JavaScript in general you'll probably be aware that those tools don't have these two characteristics above. As you'll see, this subtle improvement can have a substantial impact on your productivity as a developer for multiple reasons. Let's dive into them!
Leiningen basically gives you a REPL for running and evaluating Clojure from the command line. This is the "de facto" way to get up and running with Clojure, and it works fine. I've installed this a few times now on Mac OS, and every time I have to go look up how to do it again (scroll to the bottom for links to other tutorials on this subject). I figured writing a tutorial myself might burn it into my memory better, and also it might help out some other lucky duck that wants to start using Clojure.
Sorry for the long title, but I just wanted to make it really clear what this post was going to be about. ;) In this post I'll basically show you how my straight-from-the-docs implementation for reading from the Firebase real-time database was resulting in a terribly slow-feeling user experience and how I was easily able to "make it work" once I had an understanding of how Angular 2, Zone.js, and Firebase (and asynchronous calls in general) are all interrelated in updating the DOM with the data in your typescript code.
The bracket notation way of setting JavaScript objects is a funny thing since it's really easy to forget about when you think of objects in terms of JSON, but the square bracket notation can be super useful in certain situations, particularly when you want to set an object's key to the value of a JavaScript variable.
|
AuthorThe posts on this site are written and maintained by Jim Lynch. About Jim...
Categories
All
Archives
March 2023
|