mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
255 B
TypeScript
14 lines
255 B
TypeScript
4 years ago
|
/**
|
||
|
* 构建一组注册列表的方式
|
||
|
* 用于从其他地方统一获取数据
|
||
|
*/
|
||
|
export function buildRegList<T>(): [T[], (item: T) => void] {
|
||
|
const list: T[] = [];
|
||
|
|
||
|
const reg = (item: T) => {
|
||
|
list.push(item);
|
||
|
};
|
||
|
|
||
|
return [list, reg];
|
||
|
}
|