This file contains hidden or 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
export class TextArea extends React.Component { | |
constructor(props) { | |
super(props) | |
this.state = { | |
text: "" | |
} | |
} | |
render() { | |
return ( | |
<div> |
This file contains hidden or 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
/** | |
* You can also use an existing operator like so | |
*/ | |
const takeEveryNthSimple = (n: number) => <T>(source: Observable<T>) => | |
source.pipe(filter((value, index) => index % n === 0 )) |
This file contains hidden or 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 { combineEpics } from "redux-observable" | |
import { interval, Subject } from "rxjs" | |
import { map, takeUntil } from "rxjs/operators" | |
const disposer = new Subject() | |
export const timerEpic = () => { | |
return interval(1000).pipe( | |
takeUntil(disposer), // disposerが動くまでtimerを動かす | |
map((time) => ({ |
This file contains hidden or 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
% locale | |
LANG="ja_JP.utf8" | |
LC_COLLATE="ja_JP.UTF-8" | |
LC_CTYPE="ja_JP.UTF-8" | |
LC_MESSAGES="ja_JP.UTF-8" | |
LC_MONETARY="ja_JP.UTF-8" | |
LC_NUMERIC="ja_JP.UTF-8" | |
LC_TIME="ja_JP.UTF-8" | |
LC_ALL="ja_JP.UTF-8" |
This file contains hidden or 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
export const withMediaComponent = (DesktopComponent, MobileComponent) => { | |
return props => { | |
return ( | |
<Media query="(max-width: 768px)"> | |
{matches => | |
matches ? ( | |
<MobileComponent {...props} /> | |
) : ( | |
<DesktopComponent {...props} /> |
This file contains hidden or 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 React, { Component } from "react"; | |
import icon from "./icon.png"; | |
import styled from "styled-components"; | |
const randomAngle = () => { | |
const num = 7; // ランダムに出したい色数 | |
return (Math.ceil(Math.random() * num) * 360) / num; | |
}; | |
// ここでhue-rotate使う |
This file contains hidden or 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
// Extraの部分を作成する関数。Tuple in Rest parameter大活躍! | |
type ExtraFunction<Arg extends any[], R> = (...args: Arg) => R | |
type ActionCreator<Arg extends any[], Action> = (...args: Arg) => Action | |
// 関数のoverload | |
export function createAppAction<A extends string>( | |
type: A | |
): ActionCreator<any[], AppAction<A>> | |
export function createAppAction<A extends string, Arg extends any[], R>( |
This file contains hidden or 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 { | |
createStore, | |
Reducer, | |
Action, | |
combineReducers, | |
ActionCreatorsMapObject, | |
ReducersMapObject, | |
ActionCreator | |
} from "redux" |
This file contains hidden or 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
yarn add next @zeit/next-typescript ts-node |
This file contains hidden or 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
version: 2 | |
jobs: | |
fornt-test: | |
docker: | |
- image: circleci/node | |
steps: | |
- checkout | |
- run: yarn install | |
- run: yarn test | |
server-test: |