feat(frontend): initial search functionality (#78)

This commit is contained in:
sct
2020-09-12 10:49:48 +09:00
committed by GitHub
parent 3722a495dd
commit 342d1a3c75
14 changed files with 450 additions and 70 deletions

View File

@@ -1,3 +1,17 @@
export type Undefinable<T> = T | undefined;
export type Nullable<T> = T | null;
export type Maybe<T> = T | null | undefined;
/**
* Helps type objects with an abitrary number of properties that are
* usually being defined at export.
*
* @param component Main object you want to apply properties to
* @param properties Object of properties you want to type on the main component
*/
export function withProperties<A, B>(component: A, properties: B): A & B {
(Object.keys(properties) as (keyof B)[]).forEach((key) => {
Object.assign(component, { [key]: properties[key] });
});
return component as A & B;
}