]> Untitled Git - lemmy-ui.git/blob - src/shared/services/HistoryService.ts
Merge branch 'main' into comment-depth
[lemmy-ui.git] / src / shared / services / HistoryService.ts
1 import { History, createBrowserHistory } from "history";
2
3 export class HistoryService {
4   static #_instance: HistoryService;
5   #history: History;
6
7   private constructor() {
8     this.#history = createBrowserHistory();
9   }
10
11   static get #Instance() {
12     return this.#_instance ?? (this.#_instance = new this());
13   }
14
15   public static get history() {
16     return this.#Instance.#history;
17   }
18 }