mount

jiangts 2016-07-29T20:35:58.000281Z

in clojurescript, can states be named as non-strings?

jiangts 2016-07-29T20:40:14.000284Z

names the app.audit-log/log state as a string like this: (js/setTimeout #(mount/stop-except "#'app.audit-log/log") 500)

tolitius 2016-07-29T20:48:43.000285Z

@jiangts: the reason it is a string is because in :advanced cljs compilation mode, #'app.audit-log/log (as a "non string") would not work, since the app.audit-log namespace will be "optimized" into something like a.b, hence the state won't be found. whereas a string version of it will never change. is there a reason you would need them as non strings?

jiangts 2016-07-29T21:16:47.000290Z

ah, gotcha. I was actually hoping to conceal some of my namespaces in the resulting output

tolitius 2016-07-29T21:19:42.000291Z

@jiangts: you mean in the logs?

jiangts 2016-07-29T21:19:59.000292Z

err, in the final js output

tolitius 2016-07-29T21:20:32.000293Z

I might not be following.. where is this output go to?

jiangts 2016-07-29T21:21:01.000294Z

like, after running the :advanced compile, a js file is produced

tolitius 2016-07-29T21:21:06.000295Z

usually it is useful to have explicit "ns/state", to avoid confusion what comes from where

tolitius 2016-07-29T21:21:15.000296Z

a.. ok, to minimize the js

jiangts 2016-07-29T21:21:20.000297Z

right

tolitius 2016-07-29T21:21:28.000298Z

how many states do you have?

jiangts 2016-07-29T21:21:35.000299Z

a lot!

tolitius 2016-07-29T21:21:39.000300Z

🙂

tolitius 2016-07-29T21:21:47.000301Z

why so many? and how many is a lot?

jiangts 2016-07-29T21:22:09.000302Z

haha, using it in clojurescript to manage all sorts of things ranging from dom event listeners to setIntervals to setTimeouts to atom watches

jiangts 2016-07-29T21:22:39.000303Z

i'm writing a plugin javascript application where all the listeners attached to the DOM/js state need to be start-able and stoppable

jiangts 2016-07-29T21:23:06.000305Z

a lot is maybe like, 50 or so states

jiangts 2016-07-29T21:23:18.000306Z

but as the application grows, the # of states will likely also grow

tolitius 2016-07-29T21:24:39.000307Z

might be an interesting mental exercise to figure out how to optimize the names. (not saying it is easily done, but still..) could you open an issue: i.e. something like "cljs: optimize state names in :advance mode"?

tolitius 2016-07-29T21:25:17.000308Z

I'll think about it meanwhile.. js world and :advanced mode are quite hairy

jiangts 2016-07-29T21:25:52.000309Z

haha, yes they are! cljs is my beacon of hope in a crazy front-end world 🙂

jiangts 2016-07-29T21:26:05.000310Z

sounds good on the issue

tolitius 2016-07-29T21:26:10.000311Z

great, thanks