Advertisement
Guest User

Untitled

a guest
Feb 24th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. diff --git a/src/actions/sources.js b/src/actions/sources.js
  2. index e4437dd..9fa775a 100644
  3. --- a/src/actions/sources.js
  4. +++ b/src/actions/sources.js
  5. @@ -89,7 +89,10 @@ function loadSourceMap(generatedSource) {
  6. };
  7. });
  8.  
  9. - originalSources.forEach(s => dispatch(newSource(s)));
  10. + dispatch({
  11. + type: "ADD_SOURCES",
  12. + originalSources
  13. + });
  14. };
  15. }
  16.  
  17. diff --git a/src/actions/types.js b/src/actions/types.js
  18. index 29517bc..0d3f889 100755
  19. --- a/src/actions/types.js
  20. +++ b/src/actions/types.js
  21. @@ -73,6 +73,7 @@ type BreakpointAction =
  22.  
  23. type SourceAction =
  24. { type: "ADD_SOURCE", source: Source }
  25. + | { type: "ADD_SOURCES", sources: Array<Source> }
  26. | { type: "SELECT_SOURCE",
  27. source: Source,
  28. line?: number,
  29. diff --git a/src/reducers/sources.js b/src/reducers/sources.js
  30. index 1afb757..49da47e 100644
  31. --- a/src/reducers/sources.js
  32. +++ b/src/reducers/sources.js
  33. @@ -52,6 +52,15 @@ function update(state = State(), action: Action) : Record<SourcesState> {
  34. return state.mergeIn(["sources", action.source.id], source);
  35. }
  36.  
  37. + case "ADD_SOURCES": {
  38. + const sources: Source = action.sources;
  39. + sources.forEach(source => {
  40. + state = state.mergeIn(["sources", action.source.id], source);
  41. + });
  42. +
  43. + return state;
  44. + }
  45. +
  46. case "SELECT_SOURCE":
  47. location = {
  48. line: action.line,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement