Dactyloidae/devtools/client/dom/content/actions/grips.js
Moonchild 8c395520d9 Issue #1656 - Part 1: Nuke most vim config lines in the tree.
Since these are just interpreted comments, there's 0 impact on actual code.
This removes all lines that match /* vim: set(.*)tw=80: */ with S&R -- there are
a few others scattered around which will be removed manually in a second part.
2020-09-25 22:04:12 +08:00

53 lines
1.4 KiB
JavaScript

/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* 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/. */
/* globals DomProvider */
"use strict";
const constants = require("../constants");
/**
* Used to fetch grip prototype and properties from the backend.
*/
function requestProperties(grip) {
return {
grip: grip,
type: constants.FETCH_PROPERTIES,
status: "start",
error: false
};
}
/**
* Executed when grip properties are received from the backend.
*/
function receiveProperties(grip, response, error) {
return {
grip: grip,
type: constants.FETCH_PROPERTIES,
status: "end",
response: response,
error: error
};
}
/**
* Used to get properties from the backend and fire an action
* when they are received.
*/
function fetchProperties(grip) {
return dispatch => {
// dispatch(requestProperties(grip));
// Use 'DomProvider' object exposed from the chrome scope.
return DomProvider.getPrototypeAndProperties(grip).then(response => {
dispatch(receiveProperties(grip, response));
});
};
}
// Exports from this module
exports.requestProperties = requestProperties;
exports.receiveProperties = receiveProperties;
exports.fetchProperties = fetchProperties;