summaryrefslogtreecommitdiff
path: root/frontend/site/projects/museum/museum.actions.js
blob: 7f9867a48585ea85d2ba6de640ab0be7355d2964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as types from 'site/types'
import FontFaceObserver from 'fontfaceobserver'
import actions from 'site/actions'
import { dispatch } from 'site/store'

export const loadMuseum = () => {
  Promise.all([
    loadFonts,
    actions.site.loadGraph('last-museum'),
  ])
  .then(() => dispatch({ type: types.site.load_site }))
}

const loadFonts = () => {
  const fonts = [
    new FontFaceObserver('Gruk'),
    new FontFaceObserver('Gruk Wide', { style: 'italic' }),
    new FontFaceObserver('Gruk Medium'),
  ]
  return Promise.all(fonts.map(font => font.load()))
}