Files
test-repo/changelog_unreleased/javascript/pr-9662.md
T
Georgii Dolzhykov e721ef30ea Flatten function expression parameters in hugged last argument (#9662)
Fixes #3376
This was done for arrow functions in #1305 ("Avoid breaking arguments for last arg expansion").
This PR enables the same for function expressions unless the function expression is the only argument.
2020-11-14 13:17:01 +02:00

719 B

Flatten function expression parameters in hugged last argument (#9662 by @thorn0)

// Prettier stable
function* mySagas() {
  yield effects.takeEvery(rexpress.actionTypes.REQUEST_START, function* ({
    id
  }) {
    console.log(id);
    yield rexpress.actions(store).writeHead(id, 400);
    yield rexpress.actions(store).end(id, "pong");
    console.log("pong");
  });
}

// Prettier master
function* mySagas() {
  yield effects.takeEvery(
    rexpress.actionTypes.REQUEST_START,
    function* ({ id }) {
      console.log(id);
      yield rexpress.actions(store).writeHead(id, 400);
      yield rexpress.actions(store).end(id, "pong");
      console.log("pong");
    }
  );
}