Skip to content

Commit

Permalink
Add indent for event emitter header generation of codegen (#24445)
Browse files Browse the repository at this point in the history
Summary:
Part of #24438, add indent foe event emitter header codegen.
cc. cpojer rickhanlonii.

[General] [Fixed] - Add indent for event emitter header generation of codegen
Pull Request resolved: #24445

Differential Revision: D14930352

Pulled By: cpojer

fbshipit-source-id: 8bd03b8e12ccf9bd06546acdb744541fcb92eea1
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed Apr 14, 2019
1 parent 2a4a9f8 commit b60651d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function generateStruct(
structNameParts,
)} ${property.name};`;
})
.join('\n');
.join('\n' + ' ');

properties.forEach((property: ObjectPropertyType) => {
const name = property.name;
Expand Down Expand Up @@ -165,7 +165,7 @@ function generateEvent(componentName: string, event: EventTypeShape): string {
function generateEvents(componentName: string, component): string {
return component.events
.map(event => generateEvent(componentName, event))
.join('\n\n');
.join('\n\n' + ' ');
}

module.exports = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ struct EventsNestedObjectNativeComponentOnChangeLocationSourceStruct {
struct EventsNestedObjectNativeComponentOnChangeLocationStruct {
EventsNestedObjectNativeComponentOnChangeLocationSourceStruct source;
int x;
int y;
int x;
int y;
};
struct EventsNestedObjectNativeComponentOnChangeStruct {
Expand Down Expand Up @@ -157,9 +157,9 @@ namespace react {
struct EventsNativeComponentOnChangeStruct {
bool value;
std::string source;
int progress;
Float scale;
std::string source;
int progress;
Float scale;
};
struct EventsNativeComponentOnEventDirectStruct {
Expand All @@ -172,7 +172,7 @@ class EventsNativeComponentEventEmitter : public ViewEventEmitter {
void onChange(EventsNativeComponentOnChangeStruct value) const;
void onEventDirect(EventsNativeComponentOnEventDirectStruct value) const;
void onEventDirect(EventsNativeComponentOnEventDirectStruct value) const;
};
} // namespace react
Expand Down

0 comments on commit b60651d

Please sign in to comment.