Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Commit bc85596

Browse files
committed
Update with dynamic counter example
1 parent e2152d7 commit bc85596

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

index.html

+20-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ <h3>A Stateful Component</h2>
109109
</section>
110110
<section>
111111
<div class="main__example--column">
112-
<h3>A Todo List</h2>
112+
<h3>A Todo List</h3>
113113
<p>Here we put together a todo list. We give the component state and pass down that state to child components as props in curly braces.</p>
114114
<p>Inline events handle user interactions. All todos are saved to localStorage. On reloads, the saved items are used.</p>
115115
<p>This is available on Github for <a href='https://github.com/composor/todo-list' target='__blank'>download</a>.</p>
@@ -137,14 +137,32 @@ <h3>An Image Browser with Popup</h3>
137137
</section>
138138
<section>
139139
<div class="main__example--column">
140-
<h3>SVG Animation</h2>
140+
<h3>SVG Animation</h3>
141141
<p>Here we're using <a target="__blank" href="https://d3js.org">D3</a> to animate a Pythagoras tree using Composi's virtual DOM to update the SVG in real time. Move the cursor over the panel, or move your finger on mobile devices. As you do so, upto 2,000 rectanges will be created and destroyed based on the cursor position. This shows how efficient Composi's virtual DOM is.</p>
142142
<p>You can use many third-party libraries and frameworks with Composi, such a Redux, Mobx, RxJS, Lodash, Bootstrap, Material Design Lite, etc.</p>
143143
<p>This is available on Github for <a href='https://github.com/composor/pythagoras-dancing-tree' target='__blank'>download</a>.</p>
144144
</div>
145145
<p data-height="500" data-theme-id="6688" data-slug-hash="EbovjJ" data-default-tab="result" data-user="rbiggs" data-embed-version="2" data-pen-title="Composi with D3" class="codepen">See the Pen <a href="https://codepen.io/rbiggs/pen/EbovjJ/">Composi with D3</a> by Robert Biggs (<a href="https://codepen.io/rbiggs">@rbiggs</a>) on <a href="https://codepen.io">CodePen</a>.</p>
146146
<script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
147147
</section>
148+
149+
150+
<section>
151+
<div class="main__example--column">
152+
<h3>Dynamic Counters</h3>
153+
<p>This is a single stateful component that generates keyed couters. This is similar to how the todo app is implemented above. Each counter occupies a keyed list item. This makes it more efficient for deleting random counters from the list.</p>
154+
<p>Each counter has the events and functionality it needs to act like an independent component. In reality they are just part of a larger, all-encomposing component.</p>
155+
<p>We're also using the <code>Fragment</code> tag to generate a group of sibling elements--the buttons that constitute the counter.</p>
156+
</div>
157+
<p data-height="600" data-theme-id="6688" data-slug-hash="vJMMZL" data-default-tab="result" data-user="rbiggs" data-pen-title="Dynamic Counters"
158+
class="codepen">
159+
See the Pen
160+
<a href="https://codepen.io/rbiggs/pen/vJMMZL/">Dynamic Counters</a> by Robert Biggs (
161+
<a href="https://codepen.io/rbiggs">@rbiggs</a>) on
162+
<a href="https://codepen.io">CodePen</a>.</p>
163+
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
164+
</section>
165+
148166
</article>
149167
<footer>
150168
<section>

0 commit comments

Comments
 (0)