New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaining in AMD build? #1426

Closed
knpwrs opened this Issue Sep 2, 2015 · 1 comment

Comments

2 participants
@knpwrs

knpwrs commented Sep 2, 2015

Maybe I'm missing something obvious. The following code works:

require({
  packages: [
    {'name': 'lodash', 'location': 'lodash-amd/modern'}
  ]
}, [
  'lodash'
], function (_) {
  var value = _.chain([1,5,2,3,5]).filter(function (n) {
    return n % 2;
  }).map(function (n) {
    return n * 2;
  }).value();
  console.log(value);
});

But the following code doesn't:

require({
  packages: [
    {'name': 'lodash', 'location': 'lodash-amd/modern'}
  ]
}, [
  'lodash/chain'
], function (_) {
  var value = _.chain([1,5,2,3,5]).filter(function (n) {
    return n % 2;
  }).map(function (n) {
    return n * 2;
  }).value();
  console.log(value);
});

I seem to remember running in to this while using modules in node as well, and I've tried explicitly loading in functions I want to use, but nothing seems to work. I came across this Stackoverflow question. Is a custom build the only way to get chaining along with minimal build size?

@jdalton jdalton added the question label Sep 2, 2015

@jdalton

This comment has been minimized.

Member

jdalton commented Sep 2, 2015

At the moment chaining is not supported when cherry-picking modules.

@jdalton jdalton closed this Sep 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment