Skip to content

Instantly share code, notes, and snippets.

View whichsteveyp's full-sized avatar

Stephen Rivas Jr whichsteveyp

View GitHub Profile
@whichsteveyp
whichsteveyp / read-books-actions.js
Last active October 25, 2017 22:53
Dispatch Helpers API (allowing for custom XHR (or anything app controlled behavior
/*
Currently, I use `readResources(...)` for two main reasons:
1. easy conformity from my API responses into the reducers in a "resourceful" way,
along with all the great `getStatus()` and `meta` and `lists` benefits that each
slice has
2. it also makes XHRs for me and updates the above automatically for me
An issue with this is any time I need to control my _own_ XHRs, I loose out on the
@whichsteveyp
whichsteveyp / component-getters.jsx
Created September 14, 2017 17:11
Prop Getters?
import React from 'react';
import Downshift from 'downshift';
class Foo extends React.Component {
render() {
return <Downshift onChange={this.onChange}>
{(controls) => {
const {isOpen, inputValue, selectedItem, ...funcs} = controls;
return <div>
@whichsteveyp
whichsteveyp / action-creators.js
Last active October 25, 2017 23:40
initial API implementation WIP for action creators
import actionTypes from 'redux-resource';
const createActionCreators = (options = {}) => {
const { crudType, resourceName } = options;
const uppercaseCrud = crudType ? crudType.toUpperCase() : '';
const isValidCrudType =
uppercaseCrud === 'UPDATE' || uppercaseCrud === 'DELETE' ||
uppercaseCrud === 'READ' || uppercaseCrud === 'CREATE';
@whichsteveyp
whichsteveyp / .tsconfig
Created May 11, 2018 17:30
ultimate type system configuration
{
"exclude": [
"node_modules",
"**/*.js"
]
}
@whichsteveyp
whichsteveyp / keybase.md
Last active December 22, 2020 20:10
pls don't hack me

Keybase proof

I hereby claim:

  • I am whichsteveyp on github.
  • I am steveyp (https://keybase.io/steveyp) on keybase.
  • I have a public key ASA-vzQSWq8PKNfyfJCQt7tx1SOAqF5RVaKDRrTOGubYXAo

To claim this, I am signing this object: