- top stories index page
- header and footer
- pagination
- post page
- comments to post
- more information about the post itself
- user page
- New, Top and Best Stories
This file contains 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
const fetchMachine = Machine( | |
{ | |
id: 'OAUTH CLIENT', | |
type: 'parallel', | |
context: { | |
hasAuthorizationCode: true | |
}, | |
states: { | |
AUTHORIZED: { | |
id: 'authed', |
This file contains 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
const fetchMachine = Machine({ | |
id: 'root', | |
initial: 'INIT', | |
states: { | |
'INIT': { | |
on: { | |
'*': [ | |
{ | |
target: 'MAYBE AUTHORIZED', | |
cond: 'hasAuthorizationCode' |
This file contains 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
``` | |
// src/modules/jwt-fetch.js | |
let token; | |
const updateToken = x => { token = x }; | |
const getToken = () => fetch('/api/jwt/token').then(extractTokenFromRes); | |
const refreshToken = () => fetch('/api/jwt/token/refresh').then(extractTokenFromRes); | |
const jwtFetch = async (url, opts) => { |
This file contains 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
const api = require('./bb-got'); | |
const R = require('./nanoramda'); | |
const fn = p => p | |
.then(R.prop('body')) | |
// .then(R.prop('id')) | |
.then(R.debug) | |
.catch(R.err); | |
const opts = { headers: { Authorization: `Basic ${process.env.BB_TOKEN}` }}; |
This file contains 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
const curry = fn => (...args) => args.length < fn.length | |
? (...rest) => curry(fn)(...args, ...rest) | |
: fn(...args); | |
const applyTo = curry( (x, fn) => fn(x) ); | |
const pipe = (headFN, ...restFns) => (...args) => restFns.reduce(applyTo, headFN(...args)); | |
const prop = curry( (key, x) => x[key] ); | |
const equals = curry( (x, y) => x === y ); | |
const startsWith = curry( (str, x) => x.indexOf(str) === 0 ); |
This file contains 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
const prep = x => x.trim().replace(/\s+/gim, ' ').replace(' latest', ':').replace('❯◯', 'bump') |
This file contains 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
module.exports = { | |
keymaps: { | |
'tab:prev': 'ctrl+shift+tab', | |
'tab:next': 'ctrl+tab', | |
'pane:prev': 'alt+cmd+left', | |
'pane:next': 'alt+cmd+right', | |
}, | |
config: {}, | |
}; |
This file contains 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
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 14, | |
// font family with optional fallbacks | |
fontFamily: 'Fira Code', | |
uiFontFamily: 'Fira Code', | |
// terminal cursor background color (hex) |
NewerOlder