Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/remove store initialisation warning #194

Merged
merged 3 commits into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 3 additions & 22 deletions src/store/Store.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
import now from "lodash/now";
import {
RootContext,
Participants,
GroupContext,
ParticipantContext,
} from "../parser/index.js";
} from "@/parser";

import WidthProviderOnBrowser from "../positioning/WidthProviderFunc";
import { Coordinates } from "../positioning/Coordinates";
import { CodeRange } from "../parser/CodeRange";
import { Coordinates } from "@/positioning/Coordinates";
import { CodeRange } from "@/parser/CodeRange";
import { StoreOptions } from "vuex";

let storeInitiationTime: number = 0;
setTimeout(function () {
if (!storeInitiationTime) {
console.warn(
"[@zenuml/core] Store is a function and is not initiated in 1 second.",
);
}
}, 1000);

export interface Warning {
title: string;
message: string;
}

/*
* RenderMode
* Static: Compatible with Mermaid renderind which renders once and never update. It also disables sticky participants and hides the footer
Expand All @@ -36,7 +21,6 @@ export const enum RenderMode {
}

export interface StoreState {
warning: Warning | undefined;
code: string;
scale: number;
selected: any[];
Expand All @@ -48,11 +32,8 @@ export interface StoreState {
}
// vuex 101: Deal with sync in mutation, async in actions
const Store = (): StoreOptions<StoreState> => {
// TODO: remove state any type
storeInitiationTime = now();
return {
state: {
warning: undefined,
code: "",
theme: "theme-default",
enableScopedTheming: false,
Expand Down
Loading