-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
28 lines (24 loc) · 901 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Elm • TodoMVC</title>
<script type="text/javascript" src="elm.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="root"></div>
<script type="text/javascript">
var storedState = localStorage.getItem('movie-app-favourites');
var startingState = storedState ? JSON.parse(storedState) : null;
var app = Elm.Main.init({
node: document.getElementById('root'),
flags: startingState
});
app.ports.setStorage.subscribe(function (state) {
localStorage.setItem('movie-app-favourites', JSON.stringify(state));
});
</script>
</body>
</html>