Skip to content

Conversation

@nnnnnoel
Copy link

No description provided.

return afterSize - beforeSize;
});

return Object.fromEntries(configEntries);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏷 Object.fromEntries()
translate key-value to object like ["key","value"] => { key : value }


function sortConfigWithSize(config: IResponsibleHookConfig, order: Order = 'ASC') {
const configEntries = Object.entries(config);
configEntries.sort((before, after) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏷Tip
array.sort()를 실행하면 내부적으로 정렬된 값이 array에 반영되어 따로 할당할 필요가 없다.
이 부분 새롭게 알아갑니다. 감사합니다.

@Jeontaeyun Jeontaeyun added the REFACTORING Refactoring code label Apr 21, 2020
@Jeontaeyun Jeontaeyun changed the title Simplify [Refactoring] Simplify useMediaQeury code Apr 21, 2020
@Jeontaeyun Jeontaeyun added this to the v0.1.0 milestone Apr 21, 2020
@Jeontaeyun Jeontaeyun changed the base branch from master to develop April 21, 2020 16:38
@Jeontaeyun Jeontaeyun changed the title [Refactoring] Simplify useMediaQeury code [REFACTORING] Simplify useMediaQeury code May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

REFACTORING Refactoring code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants