Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Type more utilities #1914

Merged
merged 2 commits into from
Feb 9, 2017
Merged

Type more utilities #1914

merged 2 commits into from
Feb 9, 2017

Conversation

jasonLaster
Copy link
Contributor

Associated Issue: #1785

Summary of Changes

This makes progress on some of the remaining util files. After this there are only a handful...

  • src/utils/prefs.js
  • src/utils/pretty-print-worker.js
  • src/utils/redux-devtools.js
  • src/utils/redux/middleware/promise.js
  • src/utils/redux/middleware/thunk.js

There are still some issues here, but it's most of the way there.
https://gist.github.com/e16ffd76edb9399d4ae00d5f4a9af139

CC @jbhoosreddy, @clarkbw you might be interested in taking a look at some of the redux stuff.

@@ -6,15 +8,17 @@ const defer = require("../../defer");
const { entries, toObject } = require("../../utils");
const { executeSoon } = require("../../DevToolsUtils");

import type { ThunkArgs, ActionType } from "../../../actions/types";

const PROMISE = exports.PROMISE = "@@dispatch/promise";
let seqIdVal = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could type this as a number

const PROMISE = exports.PROMISE = "@@dispatch/promise";
let seqIdVal = 1;

function seqIdGen() {
function seqIdGen(): number {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then you wouldn't need to type the function return here.

Copy link
Contributor

@clarkbw clarkbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Haven't pulled it down, but it looks really good.

@clarkbw
Copy link
Contributor

clarkbw commented Feb 3, 2017

Still has some flow errors.

@jasonLaster jasonLaster changed the title (WIP) flow type utilities Type more utilities Feb 9, 2017
@@ -13,13 +35,13 @@ function prettyPrint({ url, indent, source }) {
mappings: prettified.map._mappings
};
} catch (e) {
return new Error(`${e.message}\n${e.stack}`);
throw new Error(`${e.message}\n${e.stack}`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an interesting change!

@jasonLaster jasonLaster merged commit c5e0793 into firefox-devtools:master Feb 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants