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

Commit 129c6ad

Browse files
Hyperloop point to master for JS
1 parent 9c64027 commit 129c6ad

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ If you are not using NPM/Webpack then you will need to bring in Hyperloop-JS in
102102
<script src="https://unpkg.com/react-router/umd/react-router.min.js"></script>
103103

104104
<!-- Opal (or bring your own) -->
105-
<script src="http://cdn.opalrb.org/opal/current/opal.min.js"></script>
105+
<script src="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/dist/opal.min.js"></script>
106106

107107
<!-- Hyperloop-js -->
108-
<script src="https://rawgit.com/ruby-hyperloop/hyperloop-js/edge/dist/hyperloop.min.js"></script>
108+
<script src="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/dist/hyperloop.min.js"></script>
109109
</head>
110110
```
111111

@@ -128,7 +128,7 @@ Or add the following to your HTML page:
128128
```html
129129
<head>
130130
<!-- Hyperloop-compiler (only needed if you are doing in browser compiling) -->
131-
<script src="https://rawgit.com/ruby-hyperloop/hyperloop-js/refactor/dist/hyperloop-compiler.min.js"></script>
131+
<script src="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/dist/hyperloop-compiler.min.js"></script>
132132
</head>
133133
```
134134

dist/index.html

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
<!-- <script src="https://unpkg.com/react-router-dom/umd/react-router-dom.min.js"></script> -->
1616

1717
<!-- Opal (or bring your own) -->
18-
<script src="http://cdn.opalrb.org/opal/current/opal.min.js"></script>
18+
<script src="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/dist/opal.min.js"></script>
1919

2020
<!-- Opal and Hyperloop -->
2121
<!-- <script src="opal.min.js"></script> -->
22-
<script src="hyperloop.min.js"></script>
23-
<script src="hyperloop-compiler.min.js"></script>
22+
<script src="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/dist/hyperloop.min.js"></script>
23+
<script src="https://rawgit.com/ruby-hyperloop/hyperloop-js/master/dist/hyperloop-compiler.min.js"></script>
2424

2525
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
2626

@@ -34,6 +34,7 @@
3434
Buttons()
3535
Clock()
3636
StylishTable()
37+
FaaS()
3738
end
3839
end
3940
end
@@ -104,6 +105,26 @@
104105
end
105106
end
106107

108+
class FaaS < Hyperloop::Component
109+
render(DIV) do
110+
BUTTON { 'faastruby.io' }.on(:click) do
111+
faast_ruby
112+
end
113+
DIV(class: :block) do
114+
P { state.hello['function_response'].to_s }
115+
P { "executed in #{state.hello['execution_time']} ms" }
116+
end if state.hello
117+
end
118+
119+
def faast_ruby
120+
HTTP.get('https://api.faastruby.io/paulo/hello-world',
121+
data: {time: true}
122+
) do |response|
123+
# this code executes when the promise resolves
124+
mutate.hello(response.json) if response.ok?
125+
end
126+
end
127+
end
107128
</script>
108129

109130
</head>

0 commit comments

Comments
 (0)