diff --git a/lib/index.js b/lib/index.js index 3317ff6..f1a36c0 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,39 +1,2 @@ -/* - * This is the main entry point for your package. - * - * You can import other modules here, including external packages. When - * bundling using rollup you can mark those modules as external and have them - * excluded or, if they have a jsnext:main entry in their package.json (like - * this package does), let rollup bundle them into your dist file. - */ - -import { add } from './utils'; - -/** - * Multiply two numbers together, returning the product. - * - * This function illustrates an export from an entry point that uses imports - * from other files. It also illustrates tail-call optimizations in ES6, - * otherwise the `negative` parameter wouldn't be here. - */ -export function multiply(n, m, negative=false) { - if (n === 0 || m === 0) { - return 0; - } else if (n === 1) { - return m; - } else if (m === 1) { - return n; - } else if (n < 0 && m < 0) { - return multiply(-n, -m); - } else if (n < 0) { - return multiply(-n, m, !negative); - } else if (m < 0) { - return multiply(n, -m, !negative); - } - - let result = n; - while (--m) { - result = add(result, n); - } - return negative ? -result : result; -} +import { createStore } from 'redux'; +createStore(function () { }) diff --git a/lib/utils.js b/lib/utils.js deleted file mode 100644 index 56ea6f2..0000000 --- a/lib/utils.js +++ /dev/null @@ -1,6 +0,0 @@ -/** - * Adds two numbers together, returning the sum. - */ -export function add(n, m) { - return n + m; -} \ No newline at end of file diff --git a/package.json b/package.json index cf2eec5..c06d788 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,10 @@ "rollup": "^0.24.1", "rollup-plugin-babel": "^2.3.9", "rollup-plugin-multi-entry": "^1.1.0", + "rollup-plugin-npm": "^1.4.0", "source-map-support": "^0.4.0" + }, + "dependencies": { + "redux": "^3.2.1" } } diff --git a/rollup.config.js b/rollup.config.js index ac73cbe..fa0be6f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,7 +1,8 @@ import babel from 'rollup-plugin-babel'; +import npm from 'rollup-plugin-npm'; export default { entry: 'lib/index.js', sourceMap: true, - plugins: [babel()] + plugins: [babel(), npm({ jsnext: true })] }; diff --git a/test/index_test.js b/test/index_test.js index e9914a4..e69de29 100644 --- a/test/index_test.js +++ b/test/index_test.js @@ -1,28 +0,0 @@ -import { multiply } from '../lib/index'; -import { strictEqual } from 'assert'; - -describe('multiply', () => { - it('returns 0 when either argument is 0', () => { - strictEqual(multiply(0, 2), 0); - strictEqual(multiply(4, 0), 0); - }); - - it('returns the value of one number if the other is 1', () => { - strictEqual(multiply(1, 8), 8); - strictEqual(multiply(5, 1), 5); - }); - - it('is commutative', () => { - strictEqual(multiply(2, 4), multiply(4, 2)); - }); - - it('returns the product of the two numbers', () => { - strictEqual(multiply(11, 9), 99); - }); - - it('handles negative numbers', () => { - strictEqual(multiply(-2, 2), -4); - strictEqual(multiply(2, -2), -4); - strictEqual(multiply(-2, -2), 4); - }); -});