-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmvpBenchGenerator.js
45 lines (40 loc) · 990 Bytes
/
mvpBenchGenerator.js
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
import { heavyRemoteSchema } from "./remote_heavyRemoteData"
import { remoteSchema } from "./remote_remoteData"
const remoteData = {
title: 'Remote Data',
data: remoteSchema(),
h: '100%',
w: '50%',
x:0,
y:0,
useCaseOptions: {
isRemoteData: true
}
}
const heavyRemoteData = {
title: 'Heavy Remote Data',
data: heavyRemoteSchema(),
h: '100%',
w: '50%',
x:2,
y:0,
useCaseOptions: {
isRemoteData: true
}
}
export const benchGenerator = (n) => {
const result = {
grid: []
};
for(let i = 0; i < n; i++) {
const remoteData_ = JSON.parse(JSON.stringify(remoteData));
const heavyRemoteData_ = JSON.parse(JSON.stringify(heavyRemoteData));
remoteData_.y = i * 4;
heavyRemoteData_.y = i * 4;
remoteData_.x = 0;
heavyRemoteData_.x = 2;
result.grid.push(remoteData_);
result.grid.push(heavyRemoteData_);
}
return result;
}