Repository navigation
Expand file tree
/
Copy pathwidecolumn.js
More file actions
111 lines (87 loc) · 1.83 KB
/
Copy pathwidecolumn.js
File metadata and controls
111 lines (87 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
const
totalItemsColumn = new Column("items", {
merge (data, oldVal) {
return oldVal ? oldVal + data.length : data.length
},
replace (data) {
return data.length
},
remove (data, oldVal) {
return oldVal ? oldVal - data.length : 0
}
}),
class Column {
constructor (name) {
this.name = name
}
validator () {
return true
}
}
class CompositeColumn {
constructor (columns) {
}
}
class ColumnFamily extends Map {
constructor (columns, key) {
this.columns = columns
this.key = key
this.map = new Map()
}
get (rowKey) {
this.map.get(rowKey)
}
set (rowKey) {
}
}
class WeakColumnFamily extends WeakMap {
constructor (...args) {
super(...args)
this.map = new WeakMap()
}
}
class ColumnFamilyAccessor {
constructor (columnFamily) {
this.columnFamily = columnFamily
}
get (rowKey) {
this.columnFamily.get()
}
put (rowKey, data) {
}
delete (rowKey) {
}
}
class keySpace {
constructor (accessors) {
for (let columnFamily in columnFamilies) {
}
}
}
[API_ENTITY.ID_KEY]:
new WeakColumnFamily(
null, // dynamic -- depends on what comprises an item
new Column(API_ENTITY.ID_KEY)
),
[ENTITY.FILTERS]:
new ColumnFamily(
[
new Column(ENTITY.TOTAL_ITEM_COUNT)
],
new Column(API_ENTITY.FILTERS)
),
[API_ENTITY.PAGE]:
new ColumnFamily(
[
new Column(API_ENTITY.ID_KEY)
],
new CompositeColumn(
[
API_ENTITY.FILTERS,
ENTITY.SORT_KEY,
ENTITY.SORT_DIRECTION,
API_ENTITY.PAGE_SIZE,
API_ENTITY.PAGE
].map(columnName => new Column(columnName))
)
),