improvement: add a code split when event is fetched
The code for parsing HTML is isomorphic and runs on server as well. Unfortunately it brings lot of dependencies and I will try to minimize the initial load of the app.
This commit is contained in:
parent
0f7d57afa0
commit
f052a66421
|
@ -21,7 +21,6 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { createEvent } from '../actions'
|
|
||||||
import logger from '../services/logger'
|
import logger from '../services/logger'
|
||||||
|
|
||||||
export let error
|
export let error
|
||||||
|
@ -38,15 +37,20 @@
|
||||||
pending ? 'input--pending': '',
|
pending ? 'input--pending': '',
|
||||||
].join(' ')
|
].join(' ')
|
||||||
|
|
||||||
const handleSubmit = (e) => {
|
const handleSubmit = async (e) => {
|
||||||
if (!form.reportValidity()) {
|
if (!form.reportValidity()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
createEvent(value, { logger })
|
try {
|
||||||
value = ''
|
const module = await import('../actions')
|
||||||
|
module.createEvent(value, { logger })
|
||||||
|
value = ''
|
||||||
|
} catch (importError) {
|
||||||
|
console.error(importError)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleChange = (e) => {
|
const handleChange = (e) => {
|
||||||
|
|
Loading…
Reference in New Issue