-
Notifications
You must be signed in to change notification settings - Fork 4
Wrapper? #5
Copy link
Copy link
Open
Description
Curious if we need the wrapper function, instead of just directly exporting the class. Doing this would allow for easy extending:
var Nanopage = require('nanopage')
class Page extends Nanopage {
formattedDate (state, value) {
try {
return someDateFormattingFunction('y-m-d', state.date)
} catch (err) {
return false
}
}
}
function view (state, emit) {
var page = new Page(state)
return html`<div>${page().formattedDate().value()}</div>`
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels