Skip to content

Commit 368c827

Browse files
removing console statements
1 parent 6f32c99 commit 368c827

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

lib/index.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,12 @@ export const persistMiddleware = (save, load) => (next) => (action) => __awaiter
5959
// Only run this code for our defined load actions
6060
if (!_isNil(targetActionAndKey)) {
6161
const { key: asyncStorageKey } = targetActionAndKey;
62-
console.log({
63-
targetActionAndKey,
64-
currentValueActionAndKeys,
65-
asyncStorageKey
66-
});
6762
// If target is nil, then no need to attempt to load from async storage
6863
if (!_isNil(asyncStorageKey)) {
6964
// Invoke our load function on the target key
7065
let payload = yield loadMethod(asyncStorageKey);
71-
console.log({ payload });
7266
// Merge the payload received from our load function
73-
// action.payload = { ...payload, ...action.payload };
67+
action.payload = Object.assign(Object.assign({}, payload), action.payload);
7468
// Update our current value target to isLoaded = true
7569
currentValue[asyncStorageKey] = Object.assign(Object.assign({}, _get(currentValue, asyncStorageKey, {})), { isLoaded: true });
7670
}
@@ -146,7 +140,6 @@ export function createPersistMachine(structure, store, debug) {
146140
});
147141
// Merges our newState object into our currentValues by key
148142
currentValue[asyncStorageKey] = Object.assign(Object.assign({}, _get(currentValue, asyncStorageKey, {})), { key: asyncStorageKey, state: newState });
149-
console.log({ currentValue }, "100");
150143
if (!_isEqual(previousValue, newState)) {
151144
/*
152145
* Each reducers value will have an `isLoaded` property, this
@@ -183,7 +176,6 @@ export function createPersistMachine(structure, store, debug) {
183176
* @param store Redux store
184177
*/
185178
function loadAutomaticReducers(store) {
186-
console.log({ currentValue }, "loadAutomatic");
187179
Object.entries(currentValue)
188180
.forEach((item) => {
189181
if (item[1].automatic) {

lib/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,11 @@ export const persistMiddleware = (save: SaveCallback, load: LoadCallback) => (ne
5959
// Only run this code for our defined load actions
6060
if (!_isNil(targetActionAndKey)) {
6161
const { key: asyncStorageKey } = targetActionAndKey;
62-
console.log({
63-
targetActionAndKey,
64-
currentValueActionAndKeys,
65-
asyncStorageKey
66-
})
6762

6863
// If target is nil, then no need to attempt to load from async storage
6964
if (!_isNil(asyncStorageKey)) {
7065
// Invoke our load function on the target key
7166
let payload = await loadMethod(asyncStorageKey);
72-
console.log({payload})
7367

7468
// Merge the payload received from our load function
7569
action.payload = { ...payload, ...action.payload };
@@ -167,7 +161,6 @@ export function createPersistMachine(structure : any, store : any, debug: boolea
167161
key: asyncStorageKey,
168162
state: newState,
169163
};
170-
console.log({currentValue}, "100")
171164

172165
if (!_isEqual(previousValue, newState)) {
173166
/*
@@ -207,7 +200,6 @@ export function createPersistMachine(structure : any, store : any, debug: boolea
207200
* @param store Redux store
208201
*/
209202
function loadAutomaticReducers(store: any) {
210-
console.log({currentValue}, "loadAutomatic")
211203
Object.entries(currentValue)
212204
.forEach((item: any) => {
213205
if (item[1].automatic) {

0 commit comments

Comments
 (0)