Skip to content

Instantly share code, notes, and snippets.

View tannerlinsley's full-sized avatar

Tanner Linsley tannerlinsley

View GitHub Profile
import { State } from 'jumpsuit'
const reducer = State({
// Initial State
initial: { count: 0 },
// Actions
increment (state, payload) {
return { count: state.count + 1 }
},
decrement (state, payload) {
import { Hook, Actions } from 'jumpsuit'
Hook((action, getState) => {
// Never letting the counter equal 10!
if (getState().counter.count === 10) {
Math.random() > 0.5 ? Actions.increment() : Actions.decrement()
}
})
// Import Jumpsuit
import { Render, State, Effect, Hook, Actions, Component } from 'jumpsuit'
// Create a state with some actions
const CounterState = State({
// Initial State
initial: { count: 0 },
import { Effect, Actions } from 'jumpsuit'
Effect('asyncIncrement', (time = 1000) => {
setTimeout(() => Actions.increment(), time)
})
import { State } from 'jumpsuit'
import _ from 'lodash'
import {FormDefaultProps} from 'react-form'
const formState = State('react-form', {
initial: {},
set (state, form) {
return {
...state,
[form.id]: form
@tannerlinsley
tannerlinsley / react-chart-brainstorm.js
Created March 1, 2017 17:53
react-chart-brainstorm
Solutions
Modules
Components
Primitives
<Path />
<Arc />
<Arc />
Responsive (Take up 100% of parent all the time)
State => Visualization
@tannerlinsley
tannerlinsley / .block
Created April 25, 2017 14:27 — forked from mbostock/.block
Bar Chart
license: gpl-3.0
@tannerlinsley
tannerlinsley / .eslintrc.js
Created May 15, 2017 19:34
prettier-eslint weirdness
module.exports = {
parserOptions: {
ecmaVersion: 8,
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
node: false
},
sourceType: 'module'
},
webpack: (config, { stage, defaultLoaders }) => {
/*
* TypeScript Support
* */
// Add .ts and .tsx extension to resolver
config.resolve.extensions.push('.ts', '.tsx')
// Add TypeScript Path Mappings (from tsconfig via webpack.config.js)
// to react-statics alias resolution
@tannerlinsley
tannerlinsley / staticgen-archive.json
Created December 21, 2018 18:33
STATICGEN.COM DATA ARCHIVE
{"timestamp":1545417093036,"data":{"ace":[{"timestamp":1545417093036,"stars":36,"forks":6,"issues":0}],"acrylamid":[{"timestamp":1545417093036,"stars":291,"forks":41,"issues":44}],"adm-dev-kit":[{"timestamp":1545417093036,"stars":29,"forks":4,"issues":11}],"amsf":[{"timestamp":1545417093036,"stars":178,"forks":90,"issues":3}],"anodize":[{"timestamp":1545417093036,"stars":3,"forks":0,"issues":0}],"antwar":[{"timestamp":1545417093036,"stars":431,"forks":32,"issues":8}],"asimov-static":[{"timestamp":1545417093036,"stars":4,"forks":4,"issues":0}],"assemble":[{"timestamp":1545417093036,"stars":3623,"forks":250,"issues":28}],"awestruct":[{"timestamp":1545417093036,"stars":260,"forks":75,"issues":56}],"bake":[{"timestamp":1545417093036,"stars":22,"forks":3,"issues":0}],"bakeit":[{"timestamp":1545417093036,"stars":1,"forks":0,"issues":0}],"baker":[{"timestamp":1545417093036,"stars":40,"forks":7,"issues":1}],"bang":[{"timestamp":1545417093036,"stars":8,"forks":1,"issues":0}],"bashblog":[{"timestamp":1545417093036,"sta