Skip to content

Commit eb43169

Browse files
authored
Merge pull request #189 from crperezt/master
Removed console.logs and cleaned up comments.
2 parents bd80695 + 927bdb4 commit eb43169

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

src/app/__tests__/SwitchApp.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ describe('Unit testing for SwitchApp.jsx', () => {
2525
value: 100,
2626
label: 'component',
2727
};
28-
// nate and edwin: mockImplementation creates a mock function call
28+
// mockImplementation creates a mock function call
2929
const dispatch = jest.fn();
3030

31-
// nate and edwin: mockImplementation creates a mock state
31+
// mockImplementation creates a mock state
3232
useStoreContext.mockImplementation(() => [state, dispatch]);
3333

3434
beforeEach(() => {

src/app/containers/ActionContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function ActionContainer() {
4646
// if true involk displayArray to display the hierarchy
4747
if (hierarchy) displayArray(hierarchy);
4848

49-
// Edwin: handles keyboard presses, function passes an event and index of each action-component
49+
// handles keyboard presses, function passes an event and index of each action-component
5050
function handleOnKeyDown(e:KeyboardEvent, i:number) {
5151
let currIndex = i;
5252
// up array key pressed

src/backend/helpers.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ export const throttle = (f, t) => {
2323
if (isOnCooldown && isCallQueued) return;
2424
if (isOnCooldown) {
2525
isCallQueued = true;
26-
console.log('snapshot update already queued');
2726
return;
2827
}
29-
console.log('no queue, updating snapshot from trigger func');
3028
f();
3129
isOnCooldown = true;
3230
isCallQueued = false;
@@ -35,14 +33,12 @@ export const throttle = (f, t) => {
3533
if (isCallQueued) {
3634
isCallQueued = false;
3735
isOnCooldown = true; // not needed I think
38-
console.log('calling queued call');
3936
f();
4037
setTimeout(runAfterTimeout, t);
4138
return;
4239
}
4340
isOnCooldown = false;
4441
};
45-
console.log('queueing snapshot update');
4642
setTimeout(runAfterTimeout, t);
4743
};
4844
return throttledFunc;

src/backend/linkFiber.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,11 @@ export default (snap: Snapshot, mode: Mode): ()=>void => {
7373
}, '*');
7474
}
7575

76-
// Carlos: Injects instrumentation to update our state tree every time
76+
// Injects instrumentation to update our state tree every time
7777
// a hooks component changes state
7878
function traverseHooks(memoizedState: any): HookStates {
7979
const hooksStates: HookStates = [];
8080
while (memoizedState && memoizedState.queue) {
81-
// Carlos: these two are legacy comments, we should look into them later
82-
// prevents useEffect from crashing on load
83-
// if (memoizedState.next.queue === null) { // prevents double pushing snapshot updates
8481
if (memoizedState.memoizedState && memoizedState.queue.lastRenderedReducer && memoizedState.queue.lastRenderedReducer.name === 'basicStateReducer') {
8582
hooksStates.push({
8683
component: memoizedState.queue,

src/backend/timeJump.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ export default (origin, mode) => {
3232

3333
if (!target) return;
3434

35-
if (target.state === 'stateless') target.children.forEach(child => jump(child));
35+
if (target.state === 'stateless') {
36+
target.children.forEach(child => jump(child));
37+
return;
38+
}
3639
const component = componentActionsRecord.getComponentByIndex(target.componentData.index);
3740
if (component && component.setState) {
3841
component.setState(prevState => {

src/extension/build/build.zip

-235 KB
Binary file not shown.

webpack.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ module.exports = (env, argv) => {
8686
},
8787
}),
8888
);
89+
} else {
90+
config.mode = 'production';
8991
}
9092
return config;
9193
};

0 commit comments

Comments
 (0)