Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit dc90b84

Browse files
authored
Update DOCS.md
1 parent 4574ff6 commit dc90b84

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

DOCS.md

+4-12
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,7 @@ Ruby has a rich set of mechanisms enabling code reuse, and Hyperloop is intended
612612
One common use case is a component wanting to update itself on a time interval. It's easy to use the kernel method `every`, but it's important to cancel your interval when you don't need it anymore to save memory. React provides [lifecycle methods](/docs/working-with-the-browser.html#component-lifecycle) that let you know when a component is about to be created or destroyed. Let's create a simple mixin that uses these methods to provide a React friendly `every` function that will automatically get cleaned up when your component is destroyed.
613613

614614

615-
<div class="codemirror-live-edit"
616-
data-heading="Using state"
617-
data-rows=33
618-
data-top-level-component="TickTock">
619-
<pre>
615+
```ruby runable
620616
module ReactInterval
621617

622618
def self.included(base)
@@ -649,7 +645,7 @@ class TickTock < Hyperloop::Component
649645
"Hyperloop has been running for #{state.seconds} seconds".para
650646
end
651647
end
652-
</pre></div>
648+
```
653649

654650
Notice that TickTock effectively has two before_mount callbacks, one that is called to initialize the `@intervals` array and another to initialize `state.seconds`
655651

@@ -798,11 +794,7 @@ Along with params components may be passed a block which is used to build the co
798794

799795
The instance method `children` returns an enumerable that is used to access the unrendered children of a component.
800796

801-
<div class="codemirror-live-edit"
802-
data-heading="The children method"
803-
data-rows=20
804-
data-top-level-component="Indenter">
805-
<pre>
797+
```ruby runable
806798
class IndentEachLine < Hyperloop::Component
807799
param by: 20, type: Integer
808800

@@ -822,7 +814,7 @@ class Indenter < Hyperloop::Component
822814
end
823815
end
824816
end
825-
</pre></div>
817+
```
826818

827819
### Lifecycle Methods
828820

0 commit comments

Comments
 (0)