Clone attachment to other piece
This commit is contained in:
@@ -9,16 +9,28 @@ export const mapProp = <const K extends string, T>(prop: K, action: Update<T>) =
|
||||
|
||||
export interface Store {
|
||||
readonly user: User | null;
|
||||
readonly pieceQueryName: string;
|
||||
readonly pieceQueryAuthor: string;
|
||||
}
|
||||
|
||||
let store: Store = Object.freeze<Store>({
|
||||
user: null,
|
||||
pieceQueryName: "",
|
||||
pieceQueryAuthor: "",
|
||||
});
|
||||
|
||||
export function setUser(action: Update<User | null>) {
|
||||
set(mapProp("user", action));
|
||||
}
|
||||
|
||||
export function setPieceQueryName(action: Update<string>) {
|
||||
set(mapProp("pieceQueryName", action));
|
||||
}
|
||||
|
||||
export function setPieceQueryAuthor(action: Update<string>) {
|
||||
set(mapProp("pieceQueryAuthor", action));
|
||||
}
|
||||
|
||||
// --- STORE IMPLEMENTATION ----------------------------------------------------
|
||||
|
||||
class Listener<T> {
|
||||
|
||||
Reference in New Issue
Block a user