-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a39c451
commit 0d44c7c
Showing
4 changed files
with
34 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="https://github.com/AlessioCoser/doom-reactive-state/releases/download/0.6.2/doom-reactive-state.global.js"></script> | ||
</head> | ||
<body> | ||
<script type="application/javascript"> | ||
const Div = doom.Div | ||
const Button = doom.Button | ||
const signal = doom.signal | ||
const derive = doom.derive | ||
const d = doom.d | ||
|
||
function App() { | ||
var [counter, setCounter] = signal(1) | ||
|
||
var onclick = () => setCounter(counter() + 1) | ||
|
||
return Div([ | ||
Div(d`${counter}`), | ||
Button({ className: "pippo", onclick }, "Increment") | ||
]) | ||
} | ||
|
||
document.body.appendChild(App()); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# doom-reactive-state Example: Load the script directly from a cdn | ||
|
||
Open the file `index.html` on the browser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="./cdn/index.global.js"></script> | ||
<script defer type="module" src="./index.ts"></script> | ||
</head> | ||
<body> | ||
<script type="application/javascript"> | ||
const Div = doom.Div | ||
const Button = doom.Button | ||
const signal = doom.signal | ||
const derive = doom.derive | ||
const d = doom.d | ||
|
||
function App() { | ||
var [counter, setCounter] = signal(1) | ||
var onclick = () => setCounter(counter() + 1) | ||
|
||
return Div([ | ||
Div(d`${counter}`), | ||
Button({ className: "pippo", onclick }, () => "Increment") | ||
]) | ||
} | ||
document.body.appendChild(App()); | ||
</script> | ||
</body> | ||
</html> |