@arcanejs/react-toolkit 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/data.d.mts CHANGED
@@ -24,6 +24,10 @@ type ProviderProps = DataFileUsage & {
24
24
  type DataFileUpdater<T> = (update: (current: T) => T) => void;
25
25
  type DataFileContext<T> = {
26
26
  data: T;
27
+ /**
28
+ * False until the initial load from disk has completed.
29
+ */
30
+ status: 'loading' | 'error' | 'ready';
27
31
  /**
28
32
  * Last timestamp where {@link DataFileContext.data data} was updated
29
33
  * in-memory.
package/dist/data.d.ts CHANGED
@@ -24,6 +24,10 @@ type ProviderProps = DataFileUsage & {
24
24
  type DataFileUpdater<T> = (update: (current: T) => T) => void;
25
25
  type DataFileContext<T> = {
26
26
  data: T;
27
+ /**
28
+ * False until the initial load from disk has completed.
29
+ */
30
+ status: 'loading' | 'error' | 'ready';
27
31
  /**
28
32
  * Last timestamp where {@link DataFileContext.data data} was updated
29
33
  * in-memory.
package/dist/data.js CHANGED
@@ -190,6 +190,7 @@ function createDataFileDefinition({
190
190
  }) {
191
191
  const context = _react.createContext.call(void 0, {
192
192
  data: defaultValue,
193
+ status: "loading",
193
194
  lastUpdatedMillis: Date.now(),
194
195
  updateData: () => {
195
196
  throw new Error("Data file provider not used");
@@ -216,6 +217,7 @@ function createDataFileDefinition({
216
217
  const providedContext = _react.useMemo.call(void 0,
217
218
  () => ({
218
219
  data: data.status !== "loading" && data.data !== void 0 ? data.data : defaultValue,
220
+ status: data.status,
219
221
  lastUpdatedMillis: data.lastUpdatedMillis,
220
222
  updateData,
221
223
  saveData,
package/dist/data.mjs CHANGED
@@ -190,6 +190,7 @@ function createDataFileDefinition({
190
190
  }) {
191
191
  const context = createContext({
192
192
  data: defaultValue,
193
+ status: "loading",
193
194
  lastUpdatedMillis: Date.now(),
194
195
  updateData: () => {
195
196
  throw new Error("Data file provider not used");
@@ -216,6 +217,7 @@ function createDataFileDefinition({
216
217
  const providedContext = useMemo(
217
218
  () => ({
218
219
  data: data.status !== "loading" && data.data !== void 0 ? data.data : defaultValue,
220
+ status: data.status,
219
221
  lastUpdatedMillis: data.lastUpdatedMillis,
220
222
  updateData,
221
223
  saveData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcanejs/react-toolkit",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "private": false,
5
5
  "description": "Build web-accessible control interfaces for your long-running Node.js processes",
6
6
  "keywords": [
@@ -62,8 +62,8 @@
62
62
  "tsup": "^8.1.0",
63
63
  "typescript": "^5.3.3",
64
64
  "zod": "^3.23.8",
65
- "@arcanejs/typescript-config": "^0.0.0",
66
- "@arcanejs/eslint-config": "^0.0.0"
65
+ "@arcanejs/eslint-config": "^0.0.0",
66
+ "@arcanejs/typescript-config": "^0.0.0"
67
67
  },
68
68
  "dependencies": {
69
69
  "lodash": "^4.17.21",