This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { async, TestBed, ComponentFixture } from '@angular/core/testing'; | |
import { BrowserCheckComponent } from './browser-check.component'; | |
describe('BrowserCheckComponent', () => { | |
let component: BrowserCheckComponent; | |
let fixture: ComponentFixture<BrowserCheckComponent>; | |
beforeEach( | |
async(() => { | |
TestBed.configureTestingModule({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "pagecall-for-tdd", | |
"version": "0.0.1", | |
"license": "MIT", | |
"scripts": { | |
"test:jest" : "jest", | |
}, | |
"jest": { | |
"preset": "jest-preset-angular", | |
"setupTestFrameworkScriptFile": "<rootDir>/src/setupJest.ts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createSelector } from '@ngrx/store'; | |
export interface State { | |
evenNums: number[]; | |
oddNums: number[]; | |
} | |
export const selectSumEvenNums = createSelector( | |
(state: State) => state.evenNums, | |
evenNums => evenNums.reduce((prev, curr) => prev + curr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.lines$.pipe( | |
filter(Boolean), | |
sample(this.frameControl$), | |
startWith([]), | |
pairwise() | |
) | |
.subscribe(([prev, next]) => { | |
this.canvasRender.drawDiff(prev, next); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "babel7-test", | |
"version": "0.0.1", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"dev": "babel-node index.js" | |
}, | |
"keywords": ["babel7"], | |
"license": "ISC", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { curry } from 'ramda'; // webpack의 tree-shaking을 사용하기 위해 { curry } 만 추출 | |
const double = n => n * 2; | |
const increment = n => n + 1; | |
const add = (x, y) => x + y; | |
const boundScore = (min, max, score) => Math.max(min, Math.min(max, score)); | |
// pipeline operator 없이 함수들을 조합한 경우 | |
const result1 = double(increment(double(double(5)))); // 42 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "babel-webpack4-exercise", | |
"version": "0.0.1", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"dev": "webpack --config webpack.development.config.js" | |
}, | |
"keywords": ["babel", "webpack4"], | |
"license": "ISC", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async componentDidMount() { | |
const { type, token } = await Facebook.logInWithReadPermissionsAsync( | |
'2060058184212334', | |
{ | |
permissions: ['public_profile', 'email'], | |
} | |
); | |
if (type === 'success') { | |
const response = await fetch( | |
`https://graph.facebook.com/me?access_token=${token}&fields=id,name,email,about,picture` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; | |
const twoDimensionArray2 = array.reduce((array, number, index) => { | |
const criteria = 4; | |
const arrayIndex = Math.floor(index / criteria); | |
if (!array[arrayIndex]) { | |
array[arrayIndex] = []; | |
} | |
array[arrayIndex] = [...array[arrayIndex], number]; | |
return array; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]; | |
const { length } = array; | |
const maxLength = 4; | |
const iteratorCount = length / maxLength; | |
let twoDimensionArray = []; | |
for (let i = 0; i < iteratorCount; i++) { | |
twoDimensionArray = [ | |
...twoDimensionArray, |