This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {createFetchAction} from './fetch-enhancer'; | |
| const API_URL = 'api/v1/projects'; | |
| export const fetchProject = createFetchAction( | |
| 'FETCH_PROJECT', | |
| 'GET', | |
| (id) => `${API_URL}/${id}` | |
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {parse, format} from "url"; | |
| import {join} from "path"; | |
| export const GET = { method: "GET" }; | |
| export const PUT = { method: "PUT" }; | |
| export const POST = { method: "POST" }; | |
| export const PATCH = { method: "PATCH" }; | |
| export const DELETE = { method: "DELETE" }; | |
| // ----------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // lib code | |
| const liftRequest = ([ req, res ]) => ({ req, res }); | |
| const liftError = ([ err, req, res ]) => ({ err, req, res }); | |
| const liftUpgrade = ([ req, socket, head ]) => ({ req, socket, head }); | |
| const unliftRequest = ({ req, res}) => [ req, res ]; | |
| const unliftError = ({ err, req, res }) => [ err, req, res ]; | |
| const unliftUpgrade = ({ req, socket, head }) => [ req, socket, head ]; | |
| const mapContextToError = ({ err, req, res }) => [ err, req, res ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var syntax = [ | |
| // React | |
| require("babel-plugin-syntax-flow"), | |
| require("babel-plugin-syntax-jsx"), | |
| // Object rest spread | |
| require("babel-plugin-syntax-object-rest-spread"), | |
| // Trailing function commas | |
| require("babel-plugin-syntax-trailing-function-commas"), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Opens the github page for the current git repository in your browser | |
| # Original credit to https://github.com/jasonneylon/ | |
| function gh() { | |
| giturl=$(git config --get remote.origin.url) | |
| if [ "$giturl" == "" ] | |
| then | |
| echo "Not a git repository or no remote.origin.url set" | |
| return | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function name(name) { | |
| return enhancer => next => (reducer, initialState) => { | |
| return { | |
| ...enhancer(next)(reducer, initialState), | |
| name, | |
| }; | |
| }; | |
| } | |
| export function normalize(store) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function ephemeral( | |
| mapSetState = identity, | |
| mapValue = identity, | |
| computeKey = defaultComputeKey | |
| ) { | |
| return Wrapped => wrapComponent(Wrapped => { | |
| function retrieveEphemeralValue(state, key) { | |
| return state[key]; | |
| } |
NewerOlder