summaryrefslogtreecommitdiff
path: root/scraper/client/types.js
blob: 6d19984d4fba9ffb483c474edbf56f0e33699cad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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'

export const USES_DATASET = {
  YES: 1,
  NO: -1,
  UNKNOWN: 0,
}