Skip to content

Instantly share code, notes, and snippets.

View kenmori's full-sized avatar
🏠
Working from home

KenjiMorita kenmori

🏠
Working from home
View GitHub Profile
@ctavan
ctavan / mutatable.jsx
Created January 17, 2017 12:13
mutatable react HOC
import hoistNonReactStatic from 'hoist-non-react-statics';
import React from 'react';
function getDisplayName(WrappedComponent) {
return WrappedComponent.displayName || WrappedComponent.name || 'Component';
}
// See: https://facebook.github.io/react/docs/higher-order-components.html
export default function mutatable({ mutationName = 'mutate' } = {}) {
return (SourceComponent) => {
@kenmori
kenmori / JavaScript.md
Last active April 12, 2024 12:25
JavaScript練習問題集(ECMAScript2015,2016,2017,2018,2019,2020,other Library)

JavaScript練習問題集

JavaScript

更新情報

・問題を追加(2024/4/12)
・リファクタリング(2023/4/22)
・Decoratorsに関する問題を追加(2020/6/6)
@msmfsd
msmfsd / es7-async-await.js
Last active February 4, 2024 17:38
Javascript fetch JSON with ES7 Async Await
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved