This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 682
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
request sender #2 -- Add http sender package boilerplate
Summary: boilerplate for http sender package Reviewed By: jgebhardt Differential Revision: D3807371 fbshipit-source-id: aab89cf5cd43a8abf4267572a724d9f34216a672
- Loading branch information
1 parent
f36f9bf
commit 610f043
Showing
3 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use babel'; | ||
/* @flow */ | ||
|
||
/* | ||
* Copyright (c) 2015-present, Facebook, Inc. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the license found in the LICENSE file in | ||
* the root directory of this source tree. | ||
*/ | ||
|
||
import xfetch from '../../commons-node/xfetch'; | ||
import {CompositeDisposable} from 'atom'; | ||
import createPackage from '../../commons-atom/createPackage'; | ||
|
||
class Activation { | ||
_disposables: CompositeDisposable; | ||
|
||
constructor(): void { | ||
this._disposables = new CompositeDisposable( | ||
atom.commands.add('atom-workspace', { | ||
'nuclide-http-request-sender:send-http-request': () => { | ||
xfetch('facebook.com', {}); | ||
}, | ||
}), | ||
); | ||
} | ||
|
||
dispose(): void { | ||
this._disposables.dispose(); | ||
} | ||
} | ||
|
||
export default createPackage(Activation); |
18 changes: 18 additions & 0 deletions
18
pkg/nuclide-http-request-sender/menus/nuclide-http-request-sender.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"menu": [ | ||
{ | ||
"label": "Nuclide", | ||
"submenu": [ | ||
{ | ||
"label": "HTTP Request Sender", | ||
"submenu": [ | ||
{ | ||
"label": "Send HTTP Request", | ||
"command": "nuclide-http-request-sender:send-http-request" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "nuclide-http-request-sender", | ||
"repository": "https://github.com/facebook/nuclide", | ||
"main": "./lib/main.js", | ||
"version": "0.0.0", | ||
"description": "Send HTTP requests from Nuclide.", | ||
"atomTestRunner": "../../lib/test-runner.js", | ||
"nuclide": { | ||
"packageType": "Atom", | ||
"testRunner": "apm" | ||
}, | ||
"activationCommands": {} | ||
} |