Skip to content

Instantly share code, notes, and snippets.

View CarsonMcKinstry's full-sized avatar

Carson McKinstry CarsonMcKinstry

View GitHub Profile
@CarsonMcKinstry
CarsonMcKinstry / ReactHooks.code-snippets
Created November 5, 2018 13:39 — forked from antmdvs/ReactHooks.code-snippets
Snippet for React *EXPERIMENTAL* `useState()` hook -- See https://reactjs.org/hooks
{
"Use State": {
"prefix": "us",
"scope": "javascript,javascriptreact,typescript,typescriptreact",
"body": [
"const [${1}, set${1/(.*)/${1:/capitalize}/}] = useState($2);",
"$0"
],
"description": "(EXPERIMENTAL) React: Use State. See https://reactjs.org/hooks"
}
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export function withAppContext<
P extends { appContext?: AppContextInterface },
R = Omit<P, 'appContext'>
>(
Component: React.ComponentClass<P> | React.StatelessComponent<P>
): React.SFC<R> {
return function BoundComponent(props: R) {
return (
@CarsonMcKinstry
CarsonMcKinstry / example.js
Created January 30, 2017 14:43 — forked from dashcraft/example.js
Free code camp part 4, rounding out javascript
const readline = require('readline');
const mike = readline.createInterface({
input: process.stdin,
output: process.stdout
});
// var person = function(personName,personAge){
// let name = personName;
// let age = personAge;