2019-06-02 00:49:47 +02:00
|
|
|
export function createEventEntry(key, roomId, event) {
|
2019-05-12 20:24:06 +02:00
|
|
|
return {
|
|
|
|
fragmentId: key.fragmentId,
|
|
|
|
eventIndex: key.eventIndex,
|
2019-06-02 00:49:47 +02:00
|
|
|
roomId,
|
2019-05-12 20:24:06 +02:00
|
|
|
event: event,
|
|
|
|
};
|
2019-05-19 20:49:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export function directionalAppend(array, value, direction) {
|
|
|
|
if (direction.isForward) {
|
|
|
|
array.push(value);
|
|
|
|
} else {
|
|
|
|
array.unshift(value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function directionalConcat(array, otherArray, direction) {
|
|
|
|
if (direction.isForward) {
|
|
|
|
return array.concat(otherArray);
|
|
|
|
} else {
|
|
|
|
return otherArray.concat(array);
|
|
|
|
}
|
|
|
|
}
|