Skip to content

Commit

Permalink
Moved useSubscription hook into a temporary package
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Mar 5, 2019
1 parent 9737d3c commit 9782f08
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/create-subscription/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@
'use strict';

export * from './src/createSubscription';
export * from './src/useSubscription';
3 changes: 3 additions & 0 deletions packages/react-hooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# react-hooks

Placeholder package.
12 changes: 12 additions & 0 deletions packages/react-hooks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

'use strict';

export * from './src/useSubscription';
7 changes: 7 additions & 0 deletions packages/react-hooks/npm/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-hooks.production.min.js');
} else {
module.exports = require('./cjs/react-hooks.development.js');
}
24 changes: 24 additions & 0 deletions packages/react-hooks/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"private": true,
"name": "react-hooks",
"description": "Reusable hooks",
"version": "16.8.3",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",
"directory": "packages/react-hooks"
},
"files": [
"LICENSE",
"README.md",
"build-info.json",
"index.js",
"cjs/"
],
"peerDependencies": {
"react": "^16.3.0"
},
"devDependencies": {
"rxjs": "^5.5.6"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('useSubscription', () => {
jest.resetModules();
jest.mock('scheduler', () => require('scheduler/unstable_mock'));

useSubscription = require('create-subscription').useSubscription;
useSubscription = require('react-hooks').useSubscription;
React = require('react');
ReactTestRenderer = require('react-test-renderer');
Scheduler = require('scheduler');
Expand Down
File renamed without changes.

0 comments on commit 9782f08

Please sign in to comment.