Skip to content

Instantly share code, notes, and snippets.

@jasonLaster
Created October 25, 2016 23:18
Show Gist options
  • Save jasonLaster/48a09ff185f13ec7fa0da30298a8603e to your computer and use it in GitHub Desktop.
Save jasonLaster/48a09ff185f13ec7fa0da30298a8603e to your computer and use it in GitHub Desktop.
diff --git a/public/js/actions/pause.js b/public/js/actions/pause.js
index fbef547..fe4c155 100644
--- a/public/js/actions/pause.js
+++ b/public/js/actions/pause.js
@@ -1,3 +1,5 @@
+// @flow
+
const constants = require("../constants");
const { selectSource } = require("./sources");
const { PROMISE } = require("../utils/redux/middleware/promise");
diff --git a/public/js/actions/types.js b/public/js/actions/types.js
index 34c05fc..2872f0d 100644
--- a/public/js/actions/types.js
+++ b/public/js/actions/types.js
@@ -87,6 +87,20 @@ type SourceAction =
sourceText: SourceText }}
| { type: "CLOSE_TAB", id: string };
+// additional properties go here!
+type PauseAction =
+ { type: "BREAK_ON_NEXT" }
+ | { type: "RESUME" }
+ | { type: "PAUSED" }
+ | { type: "PAUSE_ON_EXCEPTIONS" }
+ | { type: "COMMAND" }
+ | { type: "SELECT_FRAME" }
+ | { type: "LOAD_OBJECT_PROPERTIES" }
+ | { type: "ADD_EXPRESSION" }
+ | { type: "EVALUATE_EXPRESSION" }
+ | { type: "UPDATE_EXPRESSION" }
+ | { type: "DELETE_EXPRESSION" };
+
/**
* Actions: Source, Breakpoint, and Navigation
*
@@ -96,4 +110,5 @@ type SourceAction =
export type Action =
SourceAction
| BreakpointAction
+ | PauseAction
| { type: "NAVIGATE" };
diff --git a/public/js/reducers/pause.js b/public/js/reducers/pause.js
index dcc2501..a85e762 100644
--- a/public/js/reducers/pause.js
+++ b/public/js/reducers/pause.js
@@ -1,3 +1,5 @@
+// @flow
+
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -5,6 +7,9 @@
const constants = require("../constants");
const fromJS = require("../utils/fromJS");
+import type { Source } from "../types";
+import type { Action } from "../actions/types";
+
const initialState = fromJS({
pause: null,
isWaitingOnBreak: false,
@@ -16,7 +21,7 @@ const initialState = fromJS({
expressions: []
});
-function update(state = initialState, action, emit) {
+function update(state = initialState, action: Action) {
switch (action.type) {
case constants.PAUSED: {
const { selectedFrameId, frames, pauseInfo } = action;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment