[ClojureScript] Using Angular as a view layer for re-frame

2015-05-25 Thread Sean Tempesta
Hi everyone!

I've been a longtime lurker on the Clojurescript list, but since I'm rather 
stumped at the moment I'm coming out of my shell.  

First off, I'd like to genuflect to both Sweden and wherever Mike Thompson is 
from.  You guys have built something really cool, and I'm embarrassed to bolt 
something truly ugly onto such elegant software.

How ugly?  Well, Angular ugly.  The framework that only a mother could love.™ 
Why would I do I such a thing?  Well, I've been developing apps for the past 
couple of months and I just can't believe how nice Ionic 
 is.  It just works (most of the time) and I 
can target multiple platforms easily.  And if you pretend Angular doesn't 
exist, it's somewhat bearable.  

Which brings me to my problem: I can't figure out how to get a Reaction to kick 
Angular into doing ... whatever it is that Angular does (digesting?) to update 
the view.  I'm guessing Reagent (or maybe React) deref's the ratom and that's 
why this whole thing works?  Angular just sits there like a lump of ugly coal.  

So, at first I tried doing things the "Angular way", using $scope.$watch's and 
it leads to a rather hilarious demo:

http://clojure.tempesta.io/Re-Frame-Angular-Test/angularWatchSubs.html

[I'm not exactly sure what's going on there, but I'm guessing that the watches 
are always one value behind.]

So, then I tried directly watching the app-db atom, and it works perfectly:

http://clojure.tempesta.io/Re-Frame-Angular-Test/angularWatchAppDB.html

But I think that's not the right way to do it.  Any ideas?

Code is on Github here:
https://github.com/seantempesta/Re-Frame-Angular-Test

Both Angular examples and the Reagent version are on this test page:
http://clojure.tempesta.io/Re-Frame-Angular-Test/

Sean

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Using Angular as a view layer for re-frame

2015-05-25 Thread Sean Tempesta
So, I just saw Colin's post:

https://groups.google.com/forum/#!topic/clojurescript/jYjTCsyMRAA

and using Ratom/Run! seems to fix it.  I've updated my example code if anyone 
is interested in seeing it.  Please let me know if this isn't the right way to 
do this! :)

Sean

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Explore the ClojureScript API

2015-05-25 Thread Shaun LeBron
I designed an API reference for ClojureScript.  You can see the available 
symbols, how they relate to Clojure*, and track version history:
https://github.com/cljsinfo/api-refs/tree/catalog

* thanks to Josh Headapohl for pushing me to show related/unported clojure 
symbols

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Explore the ClojureScript API

2015-05-25 Thread Andrew Oberstar
Pretty neat! And with Github's "t" shortcut you can pretty quickly pick up
a specific function. I like having the versions something was added and
removed so easily available. Nice work!

Andrew Oberstar

On Mon, May 25, 2015 at 6:33 AM Shaun LeBron 
wrote:

> I designed an API reference for ClojureScript.  You can see the available
> symbols, how they relate to Clojure*, and track version history:
> https://github.com/cljsinfo/api-refs/tree/catalog
>
> * thanks to Josh Headapohl for pushing me to show related/unported clojure
> symbols
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] Explore the ClojureScript API

2015-05-25 Thread David Nolen
On Mon, May 25, 2015 at 7:33 AM, Shaun LeBron 
wrote:

> https://github.com/cljsinfo/api-refs/tree/catalog


Impressive and useful! Thanks for this.

David

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: PowerCursors! ;)

2015-05-25 Thread Val Waeselynck
I have been looking for exactly that, thanks!

Le vendredi 8 mai 2015 00:52:45 UTC+2, Frozenlock a écrit :
>
> You might be interested in a quick look at:
> https://github.com/Frozenlock/entanglement
>
> I wrote it after working on reagent-cursors and seeing a pattern emerge.
>
> The main purpose is to have an abstraction layer between the data and the 
> application (IE Reagent).
> This way you can decouple how Reagent is written and how your data is 
> stored in an atom.
>
> (Related Reagent issue: 
> https://github.com/reagent-project/reagent/issues/92)
>
>
> On Tuesday, May 5, 2015 at 7:47:02 PM UTC-4, marc fawzi wrote:
>>
>> So after a couple of months drooling over ClojureScript's more advanced 
>> facilities, I've finally managed to play with Protocols and Records. 
>>
>> It feels a bit OO-ish me, but can't see how I could survive without it
>>
>> Is this really functional programming or did I subconsciously revert to 
>> OO? 
>>
>> PowerCursors >>> 
>>
>> https://gist.github.com/idibidiart/0090a95b6b4f9c12c070
>>
>>
>> The previous version was a weaker abstraction which used multi-methods (
>> https://gist.github.com/idibidiart/2b3aa1594ce707227b96) and is very 
>> amateur in retrospect so I'm hoping the next version will be that much 
>> better... 
>>
>> This one doesn't even 
>>
>> If you have any feedback for this n00b please don't hesitate to share 
>> here.
>>
>> Btw, all of this digging and exploring because of one comment at our last 
>> SF Reagent meetup that cursors were just simple pointers. The latest 
>> abstraction doesn't even use any cursor per se but invents it's own simple 
>> yet more robust lensing pattern.
>>
>> Thank you for all your help answering my often ridiculous questions.
>>
>> Marc
>> p.s. the last meetup's video IS coming this Thursday, and it will put all 
>> of this "Cursors can do it all, depending on how you define them"  in 
>> context.. 
>>
>>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: Using Angular as a view layer for re-frame

2015-05-25 Thread Mike Thompson
On Monday, May 25, 2015 at 5:56:01 PM UTC+10, Sean Tempesta wrote:
> So, I just saw Colin's post:
> 
> https://groups.google.com/forum/#!topic/clojurescript/jYjTCsyMRAA
> 
> and using Ratom/Run! seems to fix it.  I've updated my example code if anyone 
> is interested in seeing it.  Please let me know if this isn't the right way 
> to do this! :)
> 
> Sean


Phew, I'm glad it works.  That's a lethal looking brew you have boiling there.  
:-)

--
Mike

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] In Om, why does transact not update cursor value.

2015-05-25 Thread John Chijioke
When a transact has happened to cursor successfully. Why does (om/value cursor) 
not return the current value in (om/state cursor) at (om/path cursor)?

John.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


Re: [ClojureScript] In Om, why does transact not update cursor value.

2015-05-25 Thread David Nolen
om/value is the cached value that was seen at the start of render which is
useful to know. You need to deref if you absolutely need to see what the
current value is.

David

On Mon, May 25, 2015 at 1:05 PM, John Chijioke  wrote:

> When a transact has happened to cursor successfully. Why does (om/value
> cursor) not return the current value in (om/state cursor) at (om/path
> cursor)?
>
> John.
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescript@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.
>

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] How to create UUIDs?

2015-05-25 Thread Colin Yates
Hi all,

(UUID. "214ecb53-2815-492a-aa11-209843bef82a") gives "WARNING: Wrong number of 
args (1) passed to UUID at line 1 "

What's the correct usage?

Thanks!

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: How to create UUIDs?

2015-05-25 Thread jack james
On Monday, May 25, 2015 at 4:32:37 PM UTC-5, Colin Yates wrote:
> Hi all,
> 
> (UUID. "214ecb53-2815-492a-aa11-209843bef82a") gives "WARNING: Wrong number 
> of args (1) passed to UUID at line 1 "
> 
> What's the correct usage?
> 
> Thanks!

pretty sure that's the correct usage. works for me at the quick start brepl 
(https://github.com/clojure/clojurescript/wiki/Quick-Start#browser-repl):

https://www.refheap.com/101665

same success w/ the rhino and node repls here.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: How to create UUIDs?

2015-05-25 Thread Francis Avila
Use (->UUID "...").

The way uuids are constructed was recently broken to add support for a cached 
hash value. A public constructor was also added. Details: 
http://dev.clojure.org/jira/browse/CLJS-1256

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.


[ClojureScript] Re: How to create UUIDs?

2015-05-25 Thread Francis Avila
Sorry, should be (uuid "...")!

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.