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(candidate): always fetch data #35

Merged
merged 1 commit into from
Mar 20, 2021
Merged

Conversation

ManiaciaChao
Copy link
Contributor

Code

No additional Action, no Fetch API inside RxJS pipeline. Just a more Rx approach :)

export const getCandidatesEpic: Epic<GetCandidatesStart> = (action$, state$, { localStorage }) => {
    const start$ = action$.pipe(ofType(GET_CANDIDATES_START));
    const fromCache$ = start$.pipe(...);
    const fromAjax$ = start$.pipe(...);
    return merge(fromCache$, fromAjax$);
}

Todo

Can we just move fromCache$ into initialization of redux store? It's a f***ing mystery to me that we always read localStorage!

@ManiaciaChao
Copy link
Contributor Author

@colinaaa @wangnengjie

@ManiaciaChao ManiaciaChao mentioned this pull request Mar 20, 2021
3 tasks
@ManiaciaChao ManiaciaChao merged commit 028d8e7 into master Mar 20, 2021
@wangnengjie
Copy link
Contributor

Maybe just move fromCache$ into initialization of redux store. Just let getCandidatesEpic do network request?

@colinaaa colinaaa deleted the feat/unify-storage branch March 21, 2021 09:02
winderica pushed a commit that referenced this pull request Jun 5, 2021
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.

2 participants