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.
tailchat/shared/manager/buildRegList.ts

14 lines
255 B
TypeScript

/**
* 构建一组注册列表的方式
* 用于从其他地方统一获取数据
*/
export function buildRegList<T>(): [T[], (item: T) => void] {
const list: T[] = [];
const reg = (item: T) => {
list.push(item);
};
return [list, reg];
}