Here's a gist. You could do this a few other ways as well, here's just one 
answer.

https://gist.github.com/Will-Sommers/4bd445e2aa4fbf7457eb

Check out lines 21 and 85.

Best,
Will

On Saturday, June 21, 2014 10:58:40 AM UTC-4, William Sommers wrote:
> You could define a function which checks for the page dimensions and then 
> updates the state atom. You can then call the function before calling om/root 
> which would then give your Om components access to the page dimensions. 
> 
> 
> 
> Best,
> 
> Will
> 
> 
> 
> On Saturday, June 21, 2014 6:44:18 AM UTC-4, Paul Cowan wrote:
> 
> > Hi,
> 
> > 
> 
> > I am new to clojure, clojurescript and OM.  I have the following code 
> > https://github.com/dagda1/web-game-of-life/blob/66fab34ef7e8a5a060fb681dfc286d7ba81d97f6/src/cljs/app.cljs.
> 
> > 
> 
> > 
> 
> > I want to get the window dimensions when the page first loads and use that 
> > to decide how big to render the components etc.
> 
> > 
> 
> > Where does such startup code go and where does this state go for the OM 
> > components to be able to access it?
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > Cheers
> 
> > 
> 
> > Paul Cowan
> 
> > 
> 
> > Cutting-Edge Solutions (Scotland)
> 
> > 
> 
> > 
> 
> > blog:      http://thesoftwaresimpleton.com/
> 
> > 
> 
> > website: http://www.cuttingedgesolutionsscotland.com/

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to