Skip to content

Instantly share code, notes, and snippets.

@mksarge
mksarge / Link.js
Created June 16, 2017 01:46
A store-connected <Link/> component for declarative navigation. Use with: https://github.com/mksarge/redux-first-routing
@mksarge
mksarge / actions.js
Created June 13, 2017 06:53
A minimal Redux-first routing implementation in <100 lines of code. Learn more: https://medium.com/@mksarge/98926ebf53cb
import { PUSH, REPLACE, GO, GO_BACK, GO_FORWARD, LOCATION_CHANGE } from './constants';
export const push = (href) => ({
type: PUSH,
payload: href,
});
export const replace = (href) => ({
type: REPLACE,
payload: href,