Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Introduce method for performing a batch of operations against a context #43

Merged
merged 1 commit into from
Nov 22, 2017

Conversation

eliperelman
Copy link
Member

@eliperelman eliperelman commented Nov 22, 2017

Allows passing a function to execute against a certain context. Basically the non-conditional version of .when().

config
  .resolve
    .batch((resolve) => {
      resolve.modules.add(MODULES);
      resolve.extensions.add('.jsx');
      resolve.alias.set('react-native', 'react-native-web');
    });
config
  .resolve
    .batch(({ modules, extensions, alias }) => {
      modules.add(MODULES);
      extensions.add('.jsx');
      alias.set('react-native', 'react-native-web');
    });

Helps avoid things like:

config
  .resolve
    .modules
      .add(MODULES)
      .end()
    .extensions
      .add('.jsx')
      .end()
    .alias
      .set('react-native', 'react-native-web');

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant