View bindings on vectors or other lists

38 views
Skip to first unread message

Jacob Emcken

unread,
Jul 9, 2014, 5:21:00 PM7/9/14
to enf...@googlegroups.com
Hi.

Is it possible to specify a view binding to render a vector (or other list) of maps, ie.:

[{:team "Team A" :score "42"} {:team "Team Q" :score "17"}]

I was looking for an example on the website but only found view bindings rendering maps.

If it is possible - would it be possible to persuade you to make a small example :)
Also if possible is there anything one should be aware of... would the entire list be re-rendered every time an element is added to the list or other things like that?


--
Kind regards
Jacob

Creighton Kirkendall

unread,
Jul 9, 2014, 5:24:50 PM7/9/14
to Enfocus

Yes its built to support any type of state object.  I will try to pull together an example for you tomorrow.

Creighton

--

---
You received this message because you are subscribed to the Google Groups "Enfocus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enfocus+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jacob Emcken

unread,
Jul 9, 2014, 5:40:11 PM7/9/14
to enf...@googlegroups.com
Nice. It is very comforting to have something which is both "certified by the owner" and working when you start out.
It feels more solid to build upon :)

I was looking at clone-for and an existing snippet in my code... are those supposed to go together?

ckirkendall

unread,
Jul 14, 2014, 10:50:59 PM7/14/14
to enf...@googlegroups.com
Jacob,
I ended up not having as much time this weekend as I would have liked and was unable to pull together an example.  I will try to get to it this week.

Creighton

ckirkendall

unread,
Jul 20, 2014, 10:27:45 PM7/20/14
to enf...@googlegroups.com
Jacob,
Here is a very simple example of using a vector in a view binding.  I will add some more to this over the next week but this should give you enough to go on.


Creighton

Jacob Emcken

unread,
Aug 26, 2014, 3:44:34 PM8/26/14
to enf...@googlegroups.com
Hi Creighton,

Thanks for the example :)

I would like to share that I've used https://github.com/tailrecursion/cljs-priority-map as a collection for a view binding and so far it seems kinda cool that adding / changing elements automaticly reorders the collection.
I

Cheers
Jacob

Jacob Emcken

unread,
Aug 28, 2014, 5:39:45 PM8/28/14
to enf...@googlegroups.com
Hi.

I have a follow-up question about view bindings on lists :)

I've "migrated" to view bindings quite a few places and stumbled over a list containing quite a few elements (around 1000-1500).

I believe that the entire list is rerendered by the view binding every time an element is added?
Is there any way to make this async to do other stuff while this goes on (around 1 sec)?... I've done a quick search on enfocus and core.async but all the code here seems to be related to events.



Cheers
Jacob


On Monday, 21 July 2014 04:27:45 UTC+2, ckirkendall wrote:
Reply all
Reply to author
Forward
0 new messages