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

fix(core): ⚡ syncer initial data name related changes #71

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
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
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
Loading