Skip to content

Commit

Permalink
fmt and rename
Browse files Browse the repository at this point in the history
  • Loading branch information
dskloetd committed Feb 2, 2023
1 parent c21c05c commit bdd4b9b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions frontend/src/lib/derived/debug.derived.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ import {
type Writable,
} from "svelte/store";

// TODO(dskloetd): Rename to createReadableStore.
const createDerivedStore = <T>(store: Writable<T>): Readable<T> =>
{ subscribe: store.subscribe };
const createReadableStore = <T>(store: Writable<T>): Readable<T> => ({
subscribe: store.subscribe,
});

let addAccountStore: Readable<AddAccountStore>;
export const debugAddAccountStore = (store: Writable<AddAccountStore>) =>
(addAccountStore = createDerivedStore(store));
(addAccountStore = createReadableStore(store));

// Context stores might not be initialized when debugger is called.
// Therefore, we need to initialize them here.
Expand All @@ -46,14 +46,14 @@ let walletStore: Readable<WalletStore> = readable({
neurons: [],
});
export const debugSelectedAccountStore = (store: Writable<WalletStore>) =>
(walletStore = createDerivedStore(store));
(walletStore = createReadableStore(store));
let selectedProposalStore: Readable<SelectedProposalStore> = readable({
proposalId: undefined,
proposal: undefined,
});
export const debugSelectedProposalStore = (
store: Writable<SelectedProposalStore>
) => (selectedProposalStore = createDerivedStore(store));
) => (selectedProposalStore = createReadableStore(store));
let selectedCanisterStore: Readable<SelectCanisterDetailsStore> = readable({
info: undefined,
details: undefined,
Expand All @@ -63,21 +63,21 @@ let selectedCanisterStore: Readable<SelectCanisterDetailsStore> = readable({
});
export const debugSelectedCanisterStore = (
store: Writable<SelectCanisterDetailsStore>
) => (selectedCanisterStore = createDerivedStore(store));
) => (selectedCanisterStore = createReadableStore(store));
let selectedProjectStore: Readable<ProjectDetailStore> = readable({
summary: null,
swapCommitment: null,
});
export const debugSelectedProjectStore = (
store: Writable<ProjectDetailStore>
) => (selectedProjectStore = createDerivedStore(store));
) => (selectedProjectStore = createReadableStore(store));
let selectedSnsNeuronStore: Readable<SelectedSnsNeuronStore> = readable({
selected: undefined,
neuron: undefined,
});
export const debugSelectedSnsNeuronStore = (
store: Writable<SelectedSnsNeuronStore>
) => (selectedSnsNeuronStore = createDerivedStore(store));
) => (selectedSnsNeuronStore = createReadableStore(store));
const transactionsStore = writable<Transaction[] | undefined>(undefined);
export const debugTransactions = (transactions: Transaction[] | undefined) => {
transactionsStore.set(transactions);
Expand Down

0 comments on commit bdd4b9b

Please sign in to comment.