Circular reference when try to update a table depending on selected rows

Here’s my take:

I used a mutable to represent the deck of cards, assigning to the mutable in an event listener that is triggered by clicking a button. The Table show’s the mutable’s value, and thus reacts to the deck being shuffled. Lastly, I used Observable’s “this” to preserve the Table’s selection even when it is redrawn. Using “this” is generally not recommended… but it seems to work well here.

Hope this helps!

1 Like