made with esnextbin
made with esnextbin
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
| require("rxjs") | |
| const Rx = require("rxjs") | |
| const { ActionsObservable } = require("redux-observable") | |
| const playgroundEpic = action$ => | |
| action$.ofType("FIRST") | |
| .map( (a) =>( { type: "THIRD" } ) ) | |
| const action$ = ActionsObservable.of({ type: 'FIRST' }, { type: 'SECOND' }) |
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: | |
| test: # 普通のテスト | |
| docker: | |
| - image: node:8 | |
| steps: | |
| - checkout | |
| - run: npm run test | |
| heavy_test: # 重いテスト | |
| docker: |
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
| $ npx create-react-app wasm-sample |
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 Vue from "vue" | |
| const OPEN_MODAL = "openModal" | |
| export const ModalEvent = new Vue({ | |
| methods: { | |
| emitOpenModal(event){ | |
| this.$emit(OPEN_MODAL, event) | |
| }, | |
| onOpenModal(cb){ | |
| this.$on(OPEN_MODAL, cb) |
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
| <!-- index.html --> | |
| <div id="app"> | |
| <my-map :markers='[ | |
| {"lat":35.6432027,"lng":139.6729435}, | |
| {"lat":35.5279833,"lng":139.6989209}, | |
| {"lat":35.6563623,"lng":139.7215211}, | |
| {"lat":35.6167531,"lng":139.5469376}, | |
| {"lat":35.6950961,"lng":139.5037899} | |
| ]'> | |
| </my-map> |
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
| // createContextでコンテキストを生成。`light`がデフォルト値 | |
| const ThemeContext = React.createContext('light'); | |
| // ユーザー情報のContext | |
| const UserContext = React.createContext(); | |
| // Contextどっちも使うパターン | |
| function Toolbar(props) { | |
| return ( | |
| {/* 初見だとちょっとギョッとするかもしれないが、childrenにfunction渡してるパターン。callbackの値として、themeが返ってくる */} |
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 logo from "./logo.svg"; | |
| import "./App.css"; | |
| const CounterContext = React.createContext(); | |
| const Child = () => { | |
| return ( | |
| <CounterContext.Consumer> | |
| {({ count, increment, decrement }) => { | |
| return ( |
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
| <some-item> | |
| <h3>Good Title</h3> | |
| <div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt</div> | |
| </some-item> |