Skip to content

Commit

Permalink
app: ghProfile: rename action type names
Browse files Browse the repository at this point in the history
  • Loading branch information
rodmax committed Nov 10, 2019
1 parent 1311075 commit 2641a76
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ The main purpose of this project is to study web applications development based
- Store
- [x] Redux
- [x] [type safety with redux](https://medium.com/@dhruvrajvanshi/some-tips-on-type-safety-with-redux-98588a85604c):
- [x] [actions naming](https://itnext.io/namespacing-redux-action-type-constant-values-90b932eea43f)
the best approach in terms of minimal boilerplate|strong typing|no unneeded abstractions/libs in my opinion
- [x] [actions naming](https://itnext.io/namespacing-redux-action-type-constant-values-90b932eea43f) -
my current choice how to name action types
- [ ] Effects/async flow: RxJs(rxjs/observable)
- [ ] Router: router5
- API client (rxjs based?)
Expand Down
2 changes: 1 addition & 1 deletion docs/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/bundle.js.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { GithubUserDto } from '../api/github-profile-api.typings'
import { rdxActionCreator } from '../../../shared/redux/redux-tools'

export const ghProfileActions = {
fetchRequested: rdxActionCreator('@ghProfile.fetchRequested').withPayload<{
fetchRequested: rdxActionCreator('@gh-profile/fetch-requested').withPayload<{
username: string
}>(),
fetchComplete: rdxActionCreator('@ghProfile.fetchComplete').withPayload<GithubUserDto>(),
fetchError: rdxActionCreator('@ghProfile.fetchError').withPayload<object>(),
fetchComplete: rdxActionCreator('@gh-profile/fetch-complete').withPayload<GithubUserDto>(),
fetchError: rdxActionCreator('@gh-profile/fetch-error').withPayload<object>(),
} as const

type ActionsObject = typeof ghProfileActions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const DEFAULT_USERNAME = 'rodmax'

export const ghProfileFetchDataEpic: Epic<GhProfileAnyAction> = action$ => {
return action$.pipe(
ofType('@ghProfile.fetchRequested'),
ofType('@gh-profile/fetch-requested'),
switchMap(action => {
return ghProfileApiClient.getProfile(action.payload.username).pipe(
map(userDto => {
Expand Down

0 comments on commit 2641a76

Please sign in to comment.