4

I am using lein cljsbuild and want to find a way to reload my compiled file without refreshing the browser. Is there a built in way to do this from my browser connected REPL?

Jon Rose
  • 1,457
  • 1
  • 15
  • 25

1 Answers1

0

Using the browser-repl can get most of that I think you are asking for. From the site:

A browser-connected REPL works in much the same way as a normal REPL: 
forms are read from the console, evaluated and return values are printed. 
A major and useful difference from normal REPL usage is that 
all side-effects occur in the browser.

This loads a page and then causes the page to wait for instructions from the repl. This way when when you reload your buffer the page will change to match.

Arthur Ulfeldt
  • 90,827
  • 27
  • 201
  • 284
  • 2
    hmm...I am pretty sure that is what I am already doing. Is there a cljs.repl function you know of to force a reload of a specific namespace? The docs for cljs.repl/load-namspace states that the given namespace will be loaded if it is not already loaded. I might be able to force a reload with load-file but it isn't ideal to have to specify a compiled .js file every time I want to reload a namespace. – Jon Rose Feb 08 '13 at 17:19