Skip to content

Instantly share code, notes, and snippets.

@caseyWebb
Created March 6, 2017 21:09
Show Gist options
  • Save caseyWebb/cdf0b4298a0512ff93af9b16db6aa45f to your computer and use it in GitHub Desktop.
Save caseyWebb/cdf0b4298a0512ff93af9b16db6aa45f to your computer and use it in GitHub Desktop.
import events from '../events'
const COURSE_TYPES = new Map([
['/', 0],
['/on-demand', 1],
['/live', 2],
['/assessment', 4]
])
export default {
title: 'Courses',
query: {
sponsors: [],
tags: [],
audiences: [],
visible: [],
statuses: {
default: [1],
coerce: (v) => v.length === 0 ? [0] : v
},
searchText: '',
sort: 'p'
},
routes: {
'/:type(|assessment|live|on-demand)': {
query: {
createQueryFactory(ctx) {
const q = ctx.$parent.query
q.set({ courseType: COURSE_TYPES.get(ctx.pathname) })
return q
}
},
collection: () => import('./collection'),
component: () => ({
template: import('./template.html'),
viewModel: import('./viewmodel')
})
}
},
components: () => ({
shared: [
'filter-button'
],
'course-list': import('./course-list')
'course-list-sorter': import('./course-list-sorter')
}),
styles: () => [
import('./styles.scss')
],
prefetch: [
events
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment