Skip to content
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 · 2 comments
Closed

Chaining in AMD build? #1426

knpwrs opened this issue Sep 2, 2015 · 2 comments
Labels

Comments

@knpwrs
Copy link

@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
Copy link
Member

@jdalton jdalton commented Sep 2, 2015

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

@jdalton jdalton closed this Sep 2, 2015
@lock
Copy link

@lock lock bot commented Jan 19, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants