mirror of
https://github.com/ryannhg/elm-spa.git
synced 2024-11-26 11:05:14 +03:00
8 lines
215 B
JavaScript
8 lines
215 B
JavaScript
const app = Elm.Main.init({
|
|
flags: JSON.parse(localStorage.getItem('storage'))
|
|
})
|
|
|
|
app.ports.save.subscribe(storage => {
|
|
localStorage.setItem('storage', JSON.stringify(storage))
|
|
app.ports.load.send(storage)
|
|
}) |