Skip to content

Commit

Permalink
apprun-play: add attr: code, hide_button
Browse files Browse the repository at this point in the history
  • Loading branch information
yysun committed May 22, 2021
1 parent e7bbf87 commit f6d7d68
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 165 deletions.
26 changes: 0 additions & 26 deletions demo-html/index.html

This file was deleted.

2 changes: 1 addition & 1 deletion dist/apprun-play.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/apprun-play.js.map

Large diffs are not rendered by default.

120 changes: 71 additions & 49 deletions esm/apprun-play.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion esm/apprun-play.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions index-apprun-play.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>AppRun Play</title>
<link rel="stylesheet" href="demo/lib/codemirror.css">
<script src="demo/lib/codemirror.js"></script>
<script src="demo/mode/javascript/javascript.js"></script>
<script src="demo/mode/xml/xml.js"></script>
<script src="demo/mode/jsx/jsx.js"></script>
<script src="dist/apprun-play.js"></script>
</head>
<body>
<textarea style="width:100%; height:300px">
const state = 0;
const view = state => {
return `<div>
<h1>${state}</h1>
<button onclick='app.run("-1")'>-1</button>
<button onclick='app.run("+1")'>+1</button>
</div>`;
};
const update = {
'+1': state => state + 1,
'-1': state => state - 1
};
app.start(document.body, state, view, update);
</textarea>
<apprun-play></apprun-play>

<textarea>
<html>
<body>
<script src="https://unpkg.com/apprun/dist/apprun-html.js"></script>
<script>
const view = state => `<div>${state}</div>`;
app.start(document.body, 'hello world', view);
</script>
</body>
</html>
</textarea>
<p>
<apprun-play></apprun-play>
</p>
</body>
</html>
36 changes: 0 additions & 36 deletions index-wc.html

This file was deleted.

Loading

0 comments on commit f6d7d68

Please sign in to comment.