summaryrefslogtreecommitdiff
path: root/scraper/client/types.js
blob: 22c93a899368007f60a36c14f20b47ac105e3a8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 system = tagAsType('system', [
  'set_sorted_citations',
])

export const init = '@@INIT'

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