This repository has been archived by the owner on Oct 4, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C-796] Refactor AudiusAPIClient to work in native context (#1687)
- Loading branch information
1 parent
a185c09
commit afdbe97
Showing
70 changed files
with
1,641 additions
and
534 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1 @@ | ||
import type { CommonState } from 'audius-client/src/common/store' | ||
import type { RemoteConfigState } from 'audius-client/src/common/store/remote-config/slice' | ||
import remoteConfig from 'audius-client/src/common/store/remote-config/slice' | ||
import { createStore, combineReducers, applyMiddleware } from 'redux' | ||
import { composeWithDevTools } from 'redux-devtools-extension' | ||
import createSagaMiddleware from 'redux-saga' | ||
|
||
import type { AudioState } from './audio/reducer' | ||
import audio from './audio/reducer' | ||
import { reducer as common } from './common/reducer' | ||
import type { DownloadState } from './download/slice' | ||
import downloads from './download/slice' | ||
import type { DrawersState } from './drawers/slice' | ||
import drawers from './drawers/slice' | ||
import type { KeyboardState } from './keyboard/slice' | ||
import keyboard from './keyboard/slice' | ||
import type { LifecycleState } from './lifecycle/reducer' | ||
import lifecycle from './lifecycle/reducer' | ||
import type { NotificationsState } from './notifications/reducer' | ||
import notifications from './notifications/reducer' | ||
import type { OAuthState } from './oauth/reducer' | ||
import oauth from './oauth/reducer' | ||
import rootSaga from './sagas' | ||
import type { SearchState } from './search/reducer' | ||
import search from './search/reducer' | ||
import type { SignonState } from './signon/reducer' | ||
import signon from './signon/reducer' | ||
import type { WebState } from './web/reducer' | ||
import web from './web/reducer' | ||
|
||
export type AppState = { | ||
audio: AudioState | ||
common: CommonState | ||
drawers: DrawersState | ||
downloads: DownloadState | ||
keyboard: KeyboardState | ||
lifecycle: LifecycleState | ||
notifications: NotificationsState | ||
oauth: OAuthState | ||
remoteConfig: RemoteConfigState | ||
search: SearchState | ||
signon: SignonState | ||
web: WebState | ||
} | ||
|
||
const createRootReducer = () => | ||
combineReducers({ | ||
audio, | ||
common, | ||
drawers, | ||
downloads, | ||
keyboard, | ||
lifecycle, | ||
notifications, | ||
oauth, | ||
remoteConfig, | ||
search, | ||
signon, | ||
web | ||
}) | ||
|
||
export default () => { | ||
const sagaMiddleware = createSagaMiddleware() | ||
const middlewares = applyMiddleware(sagaMiddleware) | ||
const composeEnhancers = composeWithDevTools({ trace: true, traceLimit: 25 }) | ||
const store = createStore(createRootReducer(), composeEnhancers(middlewares)) | ||
sagaMiddleware.run(rootSaga) | ||
return store | ||
} | ||
export * from './store' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import type { CommonState } from 'audius-client/src/common/store' | ||
import type { RemoteConfigState } from 'audius-client/src/common/store/remote-config/slice' | ||
import remoteConfig from 'audius-client/src/common/store/remote-config/slice' | ||
import { createStore, combineReducers, applyMiddleware } from 'redux' | ||
import { composeWithDevTools } from 'redux-devtools-extension' | ||
import createSagaMiddleware from 'redux-saga' | ||
|
||
import type { AudioState } from './audio/reducer' | ||
import audio from './audio/reducer' | ||
import { reducer as common } from './common/reducer' | ||
import type { DownloadState } from './download/slice' | ||
import downloads from './download/slice' | ||
import type { DrawersState } from './drawers/slice' | ||
import drawers from './drawers/slice' | ||
import type { KeyboardState } from './keyboard/slice' | ||
import keyboard from './keyboard/slice' | ||
import type { LifecycleState } from './lifecycle/reducer' | ||
import lifecycle from './lifecycle/reducer' | ||
import type { NotificationsState } from './notifications/reducer' | ||
import notifications from './notifications/reducer' | ||
import type { OAuthState } from './oauth/reducer' | ||
import oauth from './oauth/reducer' | ||
import rootSaga from './sagas' | ||
import type { SearchState } from './search/reducer' | ||
import search from './search/reducer' | ||
import type { SignonState } from './signon/reducer' | ||
import signon from './signon/reducer' | ||
import type { WebState } from './web/reducer' | ||
import web from './web/reducer' | ||
|
||
export type AppState = { | ||
audio: AudioState | ||
common: CommonState | ||
drawers: DrawersState | ||
downloads: DownloadState | ||
keyboard: KeyboardState | ||
lifecycle: LifecycleState | ||
notifications: NotificationsState | ||
oauth: OAuthState | ||
remoteConfig: RemoteConfigState | ||
search: SearchState | ||
signon: SignonState | ||
web: WebState | ||
} | ||
|
||
const createRootReducer = () => | ||
combineReducers({ | ||
audio, | ||
common, | ||
drawers, | ||
downloads, | ||
keyboard, | ||
lifecycle, | ||
notifications, | ||
oauth, | ||
remoteConfig, | ||
search, | ||
signon, | ||
web | ||
}) | ||
|
||
const sagaMiddleware = createSagaMiddleware() | ||
const middlewares = applyMiddleware(sagaMiddleware) | ||
const composeEnhancers = composeWithDevTools({ trace: true, traceLimit: 25 }) | ||
export const store = createStore( | ||
createRootReducer(), | ||
composeEnhancers(middlewares) | ||
) | ||
sagaMiddleware.run(rootSaga) | ||
|
||
const { dispatch } = store | ||
export { dispatch } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './AudiusAPIClient' |
File renamed without changes.
Oops, something went wrong.