summaryrefslogtreecommitdiff
path: root/scraper/client/types.js
blob: 53c0cff06393c52a931906a713ce5313a85ef193 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
export const asType = (type, name) => [type, name].join('_').toUpperCase()
export const tagAsType = (type, names) => (
  names.reduce((tags, name) => {
    tags[name] = asType(type, name)
    return tags
  }, {})
)

export const api = tagAsType('api', [
  'loading', 'loaded', 'error', 'set_paper_key',
])

export const init = '@@INIT'