I hereby claim:
- I am develohpanda on github.
- I am ohpanda (https://keybase.io/ohpanda) on keybase.
- I have a public key ASDZd5ZUSTt-dEnpHZxxxWwhncl2htpgKO4q9V82M7-9MAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/* variation on https://medium.com/@DanHomola/react-higher-order-components-in-typescript-made-simple-6f9b55691af1 */ | |
import * as React from 'react' | |
import { wrapDisplayName } from 'recompose' | |
// Props you want the resulting component to take (besides the props of the wrapped component) | |
interface ExternalProps {} | |
// Props the HOC adds to the wrapped component | |
export interface InjectedProps {} |
The base for this-branch
is not develop
and we need to rebase onto develop once old-parent-branch
(in the PR above) has been merged. This way history is kept clean and consistent. After re-basing, update the base branch for this PR to be develop
and delete this snippet.
git checkout develop
git pull
git rebase --onto develop <old-parent-branch> <this-branch>
git push --force
Make sure you are aware of the ramifications of using
git push --force
const node = (item?: string, separator?: string) => `${item && `${separator}${item}`}`; | |
const nodes = [ | |
node(parentEntityType), | |
node(currentEntityType, ':'), | |
node(fieldName, '::'), | |
node(fieldName && entityId, ':::'), | |
]; | |
return new Key(nodes.join('')); |
openapi: 3.0.0 | |
info: | |
version: 1.0.2 | |
title: Example | |
tags: | |
- name: folder one # converted to folders | |
- name: folder two | |
servers: | |
- url: https://petstore.swagger.io/v2 # converted to scheme, host, base_path env variables | |
paths: |
function configureRepository(token) { | |
const set = (elName, value) => { | |
document.getElementsByName(elName)[0].value = value; | |
}; | |
set('uri', 'https://github.com/develohpanda/designer.git'); | |
set('authorName', 'gh-sync'); | |
set('authorEmail', 'osrs6t3EA@gmail.com'); | |
set('username', 'gh-sync-test'); | |
set('token', token); |
import * as React from 'react'; | |
const useToggleState = (initialState: boolean = false): [boolean, () => void] => { | |
const [state, set] = React.useState(initialState); | |
const toggle = React.useCallback(() => set(oldState => !oldState), []); | |
return [state, toggle]; | |
}; | |
// Consume as | |
const [visible, toggleVisibility] = useToggleState(false); |
it.if = cb => cb() ? it : it.skip; | |
const isPackage = () => process.env.BUNDLE === 'package' | |
describe('suite', () => { | |
it.if(isPackage)('test', () => { | |
// test single | |
}); | |
it.if(isPackage).each([1,2])('test each %s', num => { |
import { ComponentType, FC, PropsWithChildren } from 'react'; | |
const Starter: FC<PropsWithChildren> = ({ children }) => <>{children}</>; | |
export const withWrappers = (...params: ComponentType<PropsWithChildren>[]) => | |
params.reduce((Previous, Current) => { | |
const Wrapped: FC<PropsWithChildren> = ({ children }) => ( | |
<Previous> | |
<Current>{children}</Current> | |
</Previous> |
function isNotNullOrUndefined<ValueType>( | |
value: ValueType | null | undefined | |
): value is ValueType { | |
if (value === null || value === undefined) { | |
return false; | |
} | |
return true; | |
} |