Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/actions/sources.js b/src/actions/sources.js
- index e4437dd..9fa775a 100644
- --- a/src/actions/sources.js
- +++ b/src/actions/sources.js
- @@ -89,7 +89,10 @@ function loadSourceMap(generatedSource) {
- };
- });
- - originalSources.forEach(s => dispatch(newSource(s)));
- + dispatch({
- + type: "ADD_SOURCES",
- + originalSources
- + });
- };
- }
- diff --git a/src/actions/types.js b/src/actions/types.js
- index 29517bc..0d3f889 100755
- --- a/src/actions/types.js
- +++ b/src/actions/types.js
- @@ -73,6 +73,7 @@ type BreakpointAction =
- type SourceAction =
- { type: "ADD_SOURCE", source: Source }
- + | { type: "ADD_SOURCES", sources: Array<Source> }
- | { type: "SELECT_SOURCE",
- source: Source,
- line?: number,
- diff --git a/src/reducers/sources.js b/src/reducers/sources.js
- index 1afb757..49da47e 100644
- --- a/src/reducers/sources.js
- +++ b/src/reducers/sources.js
- @@ -52,6 +52,15 @@ function update(state = State(), action: Action) : Record<SourcesState> {
- return state.mergeIn(["sources", action.source.id], source);
- }
- + case "ADD_SOURCES": {
- + const sources: Source = action.sources;
- + sources.forEach(source => {
- + state = state.mergeIn(["sources", action.source.id], source);
- + });
- +
- + return state;
- + }
- +
- case "SELECT_SOURCE":
- location = {
- line: action.line,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement