Skip to content

Commit

Permalink
Merge pull request #71 from wrappid/WRPD-enhancement-28
Browse files Browse the repository at this point in the history
fix(core): ⚡ syncer initial data name related changes
  • Loading branch information
techoneel authored Mar 20, 2024
2 parents 71271d0 + 0c71cff commit f2b60b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions package/context/WrappidSyncer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import React from "react";
// eslint-disable-next-line import/order
import { DEFAULT_THEME } from "../theme/theme";
import {
updateWrappidContext,
WrapidDataType,
wrappidData,
WrappidDataContext,
WrappidDispatchContext
WrappidDispatchContext,
updateWrappidContext,
wrappidInitialData
} from "./WrappidContext";
import wrappidReducer, { UPDATE_DATA } from "./wrappidReducer";

export let WrappidData: WrapidDataType = { ...wrappidData };
export let WrappidData: WrapidDataType = { ...wrappidInitialData };

export default function WrappidSyncer({
children,
Expand All @@ -22,7 +22,7 @@ export default function WrappidSyncer({
}) {
const [wrappidReducerState, dispatch] = React.useReducer(
wrappidReducer,
wrappidData
wrappidInitialData
);

React.useEffect(() => {
Expand Down
6 changes: 3 additions & 3 deletions package/context/wrappidReducer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WrapidDataType, wrappidData } from "./WrappidContext";
import { WrapidDataType, wrappidInitialData } from "./WrappidContext";

export const UPDATE_DATA = "UPDATE_DATA";
export const UPDATE_DEVELOPMENT_DATA = "UPDATE_DEVELOPMENT_DATA";
Expand All @@ -10,7 +10,7 @@ export const UPDATE_MODULE_DATA = "UPDATE_MODULE_DATA";
export type PayloadType = any;

const wrappidReducer = (
state: WrapidDataType = wrappidData,
state: WrapidDataType = wrappidInitialData,
{ type, payload }: { type: string; payload: PayloadType }
) => {
switch (type) {
Expand Down Expand Up @@ -74,7 +74,7 @@ const wrappidReducer = (
}

case RESET_DATA: {
return wrappidData;
return wrappidInitialData;
}

default: {
Expand Down

0 comments on commit f2b60b2

Please sign in to comment.