I hereby claim:
- I am rdazvd on github.
- I am rdazvd (https://keybase.io/rdazvd) on keybase.
- I have a public key ASDFpN1iWnVhKGSLuldmpqU4Y7r2rmAuohWz_f54lunf2Qo
To claim this, I am signing this object:
import fs from 'fs'; | |
export abstract class CsvFileReader<T> { | |
data: T[] = []; | |
constructor(public filename: string) {} | |
abstract mapRow(row: string[]): T; | |
read(): void { |
// This config file makes sure Jest is using Next.js's Babel preset. | |
{ | |
"presets": ["next/babel"] | |
} |
import React, { useState, useEffect } from 'react'; | |
const Dropdown = ({ options, label, selected, onSelectedChange }) => { | |
const [open, setOpen] = useState(false); | |
const ref = React.useRef(); | |
useEffect(() => { | |
const onBodyClick = (event) => { | |
if (ref.current && ref.current.contains(event.target)) { | |
return; |
I hereby claim:
To claim this, I am signing this object:
import React from 'react'; | |
export default (reducer, actions, initialState) => { | |
const Context = React.createContext(); | |
const Provider = ({ children }) => { | |
const [state, dispatch] = React.useReducer(reducer, initialState); | |
const boundActions = {}; | |
for (let key in actions) { | |
boundActions[key] = actions[key](dispatch); |
interface Mappable { | |
location: { | |
lat: number; | |
lng: number; | |
}; | |
} | |
export class CustomMap { | |
private googleMap: google.maps.Map; |
const debounce = (functionToBeCalled, delay = 1000) => { | |
let timeoutId; | |
return (...functionArgs) => { | |
if (timeoutId) clearTimeout(timeoutId); | |
timeoutId = setTimeout( | |
() => functionToBeCalled.apply(null, functionArgs), | |
delay | |
); | |
}; | |
}; |
const fetchData = async () => { | |
... | |
}; | |
let timeoutId; | |
const onInput = event => { | |
if (timeoutId) clearTimeout(timeoutId); | |
timeoutId = setTimeout(() => fetchData(event.target.value), 1000); // adjust debouncing time accordingly | |
}; |
// adapt setState function name and new state value according to your case | |
const handleInputChange = event => | |
setState([event.target.name]: event.target.value); |
Copyright (YEAR) (COPYRIGHT HOLDER)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The Software may not be used by individuals, corporations, governments, or other groups for systems or activities that actively and knowingly endanger, harm, or otherwise threaten the physical, mental, economic, or general well-being of individuals or groups in violation of the United Nations Universal Declaration of Human Rights (https://www.un.org/en/universal-declaration-human-rights/).
THE SOFTWARE IS PROVIDED "