Move WorkerPoolContext into WorkerPool.ts
This commit is contained in:
parent
eebae85a65
commit
5dd061627a
@ -1,6 +1,6 @@
|
||||
import React, { useContext } from "react";
|
||||
|
||||
import { WorkerPoolContext } from "../pages/index";
|
||||
import { WorkerPoolContext } from "../lib/WorkerPool";
|
||||
import { useAppDispatch } from "../lib/hooks";
|
||||
import { clearPlugins, setPending } from "../slices/plugins";
|
||||
import styles from "../styles/DataDirPicker.module.css";
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { createContext } from "react";
|
||||
|
||||
import {
|
||||
addPluginInOrder,
|
||||
decrementPending,
|
||||
@ -78,4 +80,6 @@ export class WorkerPool {
|
||||
}
|
||||
this.availableWorkers = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const WorkerPoolContext = createContext<WorkerPool | null>(null);
|
@ -1,4 +1,4 @@
|
||||
import { createContext, useEffect, useCallback, useState } from "react";
|
||||
import { useEffect, useCallback, useState } from "react";
|
||||
import type { NextPage } from "next";
|
||||
import Head from "next/head";
|
||||
import "mapbox-gl/dist/mapbox-gl.css";
|
||||
@ -6,9 +6,7 @@ import "mapbox-gl/dist/mapbox-gl.css";
|
||||
import Map from "../components/Map";
|
||||
import { useAppDispatch } from "../lib/hooks";
|
||||
import { setPluginsTxtAndApplyLoadOrder } from "../slices/pluginsTxt";
|
||||
import { WorkerPool } from "../lib/WorkerPool";
|
||||
|
||||
export const WorkerPoolContext = createContext<WorkerPool | null>(null);
|
||||
import { WorkerPool, WorkerPoolContext } from "../lib/WorkerPool";
|
||||
|
||||
const Home: NextPage = () => {
|
||||
const [workerPool, setWorkerPool] = useState<WorkerPool | null>(null);
|
||||
|
Loading…
Reference in New Issue
Block a user