gamja/state.js

27 lines
452 B
JavaScript
Raw Normal View History

2020-06-26 04:35:38 -04:00
export const BufferType = {
SERVER: "server",
CHANNEL: "channel",
NICK: "nick",
};
2020-06-24 10:56:28 -04:00
export const Status = {
DISCONNECTED: "disconnected",
CONNECTING: "connecting",
REGISTERED: "registered",
};
export const Unread = {
NONE: "",
MESSAGE: "message",
2020-06-29 05:08:47 -04:00
HIGHLIGHT: "highlight",
2020-06-24 10:56:28 -04:00
union: (a, b) => {
const priority = {
[Unread.None]: 0,
[Unread.MESSAGE]: 1,
2020-06-29 05:08:47 -04:00
[Unread.HIGHLIGHT]: 2,
2020-06-24 10:56:28 -04:00
};
return (priority[a] > priority[b]) ? a : b;
},
};