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

Training6 task2 #59

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

thienvu23
Copy link

Training 6 task 2 is complete


function* networkSaga() {
try {
yield delay(500);
Copy link
Collaborator

@vanbui1995 vanbui1995 Sep 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thienvu23 why do we need to use delay here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to delay and put action network status here, you can set default navigator.onLine on reducer I commented above


function* networkCheckAutoSubmitting() {
let taskRunSubmittingAuto;
while (true) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thienvu23
we don't put network action in the init app anymore, so you need to change code here a bit

import { syncNetworkStatus } from "../actions/network";

const initialState = {
isConnected: false,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should get from navigator.onLine instead of set to false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants