Skip to content

Instantly share code, notes, and snippets.

View derekr's full-sized avatar
💭
Chillin'

Derek Reynolds derekr

💭
Chillin'
View GitHub Profile

Redux JSON-API Notes

  • Colocation of requests and where the properties at being used
  • Bubbling up/emrging duplicate requests (is this even really possible or good w/ json-api?)
  • Helpful warning messages for improving requests (eg "You're requesting all fields, but only selecting 3.")
  • Simplify selecting fields from the requested resource (eliminate caller needing to use safe-access)
  • Auto namespace requests
  • Select request state (use getLoadingFn internally)
  • Internalize all things like makeRefReducer… these are implementation details a caller shouldn't care about (maybe a separate module for all this tooling?)
  • Avoid abstracting away json-api details… it should be obvious that's the type of api we're working with?

/containers/App.jsx

import { Provider } from 'react-redux'

import Widget, { createStore as widgetStore } from 'components/Widget'
import Something, { createStore as somethingStore } from 'components/Something'

export default () => {
    onComponentDidMount() {
        this.setState({

Keybase proof

I hereby claim:

  • I am derekr on github.
  • I am drk (https://keybase.io/drk) on keybase.
  • I have a public key ASBbxQGbNRZ_cAH5ZqZbpckqhrjmkh1zNxmeAUS2jCTGsgo

To claim this, I am signing this object:

@derekr
derekr / data.json
Last active August 29, 2015 14:26
data! from editdata.org!
[{"key":1,"value":{"name":"Something","key":"Something"}}]
defaults write -app ‘sketch’ ApplePersistence -bool no
@derekr
derekr / personalfinance-twitter.txt
Created July 22, 2015 23:50
future sources for a finance twitter bot
https://twitter.com/mrmoneymustache
https://twitter.com/BudgetsAreSexy
https://twitter.com/ronlieber
https://twitter.com/lizweston
@financialsamura
@LenPenzo
@FrugalWoods
@thepointsguy
@derekr
derekr / index.js
Created July 15, 2015 01:44
unarchived instapaper videos
var fs = require('fs')
var csv = require('csv-parser')
var map = require('map-stream')
fs.createReadStream(__dirname + '/instapaper-export.csv')
.pipe(csv())
.pipe(map(function (data, cb) {
if (
data.Folder !== 'Archive' &&
data.URL.indexOf('youtube') === -1 &&
waitFor @ vendor.bundle.js:25910
module.exports.alt.createStore.onFilterPagedArticles @ paged-articles.js:22
(anonymous function) @ vendor.bundle.js:25748
Dispatcher.$Dispatcher_invokeCallback @ vendor.bundle.js:619
Dispatcher.dispatch @ vendor.bundle.js:594
dispatch @ vendor.bundle.js:26048
dispatch @ vendor.bundle.js:25812
PagedArticlesActions.filterPagedArticles @ paged-articles.js:10
React.createClass.componentDidMount @ post.jsx:23
assign.notifyAll @ vendor.bundle.js:4797

Ideas for helping improve documentation and awareness around documentation. Inspired by https://gist.github.com/tmcw/5f69a7902f4196153ce8

  • Badges encouraging doc related contributions… [Improve This Doc]
  • Central site that documents environment setup flows for different platforms
    Your on Windows -> do this
    Your on Mac -> do this instead
    
var marker = L.marker(
[venue.location.lat, venue.location.lng],
{ riseOnHover: true }
).bindLabel(venue.name, { direction: 'auto' });
marker.toGetJSON();
// returns a json object
{
geometry: { coordinates: [], type: 'point' },