Skip to content

Commit

Permalink
make compute own helper then drop ember-composable-helpers as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
fran-worley committed Apr 8, 2020
1 parent 3118f85 commit 9705912
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 33 deletions.
10 changes: 10 additions & 0 deletions addon/helpers/compute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// https://github.com/DockYard/ember-composable-helpers/blob/master/addon/helpers/compute.js

import { helper } from '@ember/component/helper';

export function compute([action, ...params]) {
console('own helper');
return action(...params);
}

export default helper(compute);
1 change: 1 addition & 0 deletions app/helpers/compute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default, compute } from 'ember-light-table/helpers/compute';
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"ember-cli-babel": "^7.17.2",
"ember-cli-htmlbars": "^4.2.2",
"ember-cli-string-helpers": "^4.0.6",
"ember-composable-helpers": "^2.4.0",
"ember-get-config": "^0.2.4",
"ember-in-viewport": "^3.7.2",
"ember-scrollable": "^1.0.2",
Expand Down Expand Up @@ -62,6 +61,7 @@
"ember-cli-uglify": "^3.0.0",
"ember-cli-yuidoc": "0.9.1",
"ember-code-snippet": "^3.0.0",
"ember-composable-helpers": "^3.1.1",
"ember-concurrency": "^1.0.0",
"ember-data": "^3.16.0",
"ember-disable-prototype-extensions": "^1.1.3",
Expand Down
22 changes: 22 additions & 0 deletions tests/integration/helpers/compute-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// https://github.com/DockYard/ember-composable-helpers/blob/master/tests/integration/helpers/compute-test.js

import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

module('Integration | Helper | {{compute}}', function(hooks) {
setupRenderingTest(hooks);

hooks.beforeEach(function() {
this.actions = {};
this.send = (actionName, ...args) => this.actions[actionName].apply(this, args);
});

test("It calls an action and returns it's value", async function(assert) {
this.actions.square = (x) => x * x;
await render(hbs`{{compute (action "square") 4}}`);

assert.equal(this.element.textContent.trim(), '16', '4 squared is 16');
});
});
64 changes: 32 additions & 32 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5990,34 +5990,7 @@ ember-cli-babel@^6.0.0, ember-cli-babel@^6.0.0-beta.4, ember-cli-babel@^6.10.0,
ember-cli-version-checker "^2.1.2"
semver "^5.5.0"

ember-cli-babel@^7.1.0, ember-cli-babel@^7.1.3, ember-cli-babel@^7.5.0, ember-cli-babel@^7.7.3:
version "7.7.3"
resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.7.3.tgz#f94709f6727583d18685ca6773a995877b87b8a0"
integrity sha512-/LWwyKIoSlZQ7k52P+6agC7AhcOBqPJ5C2u27qXHVVxKvCtg6ahNuRk/KmfZmV4zkuw4EjTZxfJE1PzpFyHkXg==
dependencies:
"@babel/core" "^7.0.0"
"@babel/plugin-proposal-class-properties" "^7.3.4"
"@babel/plugin-proposal-decorators" "^7.3.0"
"@babel/plugin-transform-modules-amd" "^7.0.0"
"@babel/plugin-transform-runtime" "^7.2.0"
"@babel/polyfill" "^7.0.0"
"@babel/preset-env" "^7.0.0"
"@babel/runtime" "^7.2.0"
amd-name-resolver "^1.2.1"
babel-plugin-debug-macros "^0.3.0"
babel-plugin-ember-modules-api-polyfill "^2.8.0"
babel-plugin-module-resolver "^3.1.1"
broccoli-babel-transpiler "^7.1.2"
broccoli-debug "^0.6.4"
broccoli-funnel "^2.0.1"
broccoli-source "^1.1.0"
clone "^2.1.2"
ember-cli-babel-plugin-helpers "^1.1.0"
ember-cli-version-checker "^2.1.2"
ensure-posix-path "^1.0.2"
semver "^5.5.0"

ember-cli-babel@^7.10.0, ember-cli-babel@^7.11.0, ember-cli-babel@^7.11.1, ember-cli-babel@^7.12.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.17.2, ember-cli-babel@^7.18.0:
ember-cli-babel@^7.1.0, ember-cli-babel@^7.10.0, ember-cli-babel@^7.11.0, ember-cli-babel@^7.11.1, ember-cli-babel@^7.12.0, ember-cli-babel@^7.13.2, ember-cli-babel@^7.17.2, ember-cli-babel@^7.18.0:
version "7.19.0"
resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.19.0.tgz#e6eddea18a867231fcf90a80689e92b98be9a63b"
integrity sha512-HiWKuoyy35vGEr+iCw6gUnQ3pS5qslyTlKEDW8cVoMbvZNGYBgRxHed5nklVUh+BS74AwR9lsp25BTAagYAP9Q==
Expand Down Expand Up @@ -6049,6 +6022,33 @@ ember-cli-babel@^7.10.0, ember-cli-babel@^7.11.0, ember-cli-babel@^7.11.1, ember
rimraf "^3.0.1"
semver "^5.5.0"

ember-cli-babel@^7.1.3, ember-cli-babel@^7.5.0, ember-cli-babel@^7.7.3:
version "7.7.3"
resolved "https://registry.yarnpkg.com/ember-cli-babel/-/ember-cli-babel-7.7.3.tgz#f94709f6727583d18685ca6773a995877b87b8a0"
integrity sha512-/LWwyKIoSlZQ7k52P+6agC7AhcOBqPJ5C2u27qXHVVxKvCtg6ahNuRk/KmfZmV4zkuw4EjTZxfJE1PzpFyHkXg==
dependencies:
"@babel/core" "^7.0.0"
"@babel/plugin-proposal-class-properties" "^7.3.4"
"@babel/plugin-proposal-decorators" "^7.3.0"
"@babel/plugin-transform-modules-amd" "^7.0.0"
"@babel/plugin-transform-runtime" "^7.2.0"
"@babel/polyfill" "^7.0.0"
"@babel/preset-env" "^7.0.0"
"@babel/runtime" "^7.2.0"
amd-name-resolver "^1.2.1"
babel-plugin-debug-macros "^0.3.0"
babel-plugin-ember-modules-api-polyfill "^2.8.0"
babel-plugin-module-resolver "^3.1.1"
broccoli-babel-transpiler "^7.1.2"
broccoli-debug "^0.6.4"
broccoli-funnel "^2.0.1"
broccoli-source "^1.1.0"
clone "^2.1.2"
ember-cli-babel-plugin-helpers "^1.1.0"
ember-cli-version-checker "^2.1.2"
ensure-posix-path "^1.0.2"
semver "^5.5.0"

ember-cli-code-coverage@^0.4.2:
version "0.4.2"
resolved "https://registry.yarnpkg.com/ember-cli-code-coverage/-/ember-cli-code-coverage-0.4.2.tgz#bd223af453ef0b80e5482cc9958cd9726b5865c7"
Expand Down Expand Up @@ -6556,10 +6556,10 @@ ember-component-inbound-actions@^1.3.0:
dependencies:
ember-cli-babel "^6.16.0"

ember-composable-helpers@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/ember-composable-helpers/-/ember-composable-helpers-2.4.0.tgz#024bd6a8c338cc9cdf10f1141b119b8f72de205f"
integrity sha512-91ZqFnNG1EDL3WzxXWTgAy6EonPS7htWHletI5SOw5ezEzKbt6EGNBwT6QPhwariugtR8LEfYNQ9lXEiCZrX1w==
ember-composable-helpers@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/ember-composable-helpers/-/ember-composable-helpers-3.1.1.tgz#9d663f4359fd54fd369ea60aa1915bf59113bcec"
integrity sha512-lPmPhk4wIg1JDnuOfzcDzrCZoaDoTvZrYVaBi4Eia2SdEEfcDNipQTXTk0yHFCvKfSjXjuNlTtNP9UANH58TzQ==
dependencies:
"@babel/core" "^7.0.0"
broccoli-funnel "2.0.1"
Expand Down

0 comments on commit 9705912

Please sign in to comment.