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
import * as R from 'ramda' | |
import * as E from 'fp-ts/lib/Either' | |
import * as O from 'fp-ts/lib/Option' | |
import { pipe, flow } from 'fp-ts/function' | |
import { sequenceT } from 'fp-ts/lib/Apply' | |
R.product([1, 2, 3]) | |
R.product([O.some(1), O.some(2), O.some(3)]) |
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
Machine({ | |
id: 'floom', | |
strict: true, | |
initial: 'initialised', | |
context: { | |
timer: 2, | |
gameId: '', | |
playerCount: 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 data = { | |
a: [{ | |
type: 'a', | |
value: 0, | |
name: 'Adam', | |
}, { | |
type: 'b', | |
value: 1, | |
name: 'Dave', | |
}], |
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
export interface Action extends React.ReducerAction<any> { | |
type: string; | |
payload?: {}; | |
} | |
export interface State { | |
[key: string]: {}; | |
} | |
export const combineReducers = ( |
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
// compose : array<func> -> value -> value | |
const compose = (...fns) => val => fns.reduce((fnA, fnB) => fnA(fnB(val))) |
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
// _pipe : funcs -> value -> value | |
const _pipe = (f, g) => (x) => g(f(x)) | |
// pipe : funcs -> value -> func | |
export const pipe = (...fns) => (x) => fns.reduce(_pipe) |
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
.container { | |
// styles | |
&--offset { | |
margin: 0 -1rem; | |
} | |
&__span { | |
// styles | |
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
<div class="container"> | |
<div class="container__span"> | |
<label class="field"> | |
<span class="field__label">Your Name</span> | |
<input type="text" class="field__input" placeholder="First name"> | |
</label> | |
</div> | |
<div class="container__span"> | |
<label class="field"> |
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
.container { | |
display: flexbox; | |
flex-wrap: wrap; | |
padding: 0 .5rem; | |
// modifiers go here | |
&__span { | |
flex: 1 0 100%; | |
padding: .5rem; |
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
@function _block-name($modifier-class) { | |
$modifier-class: #{$modifier-class}#{''}; | |
@return str-slice($modifier-class, 1, (str-index($modifier-class, '--') - 1)); | |
} | |
@mixin modify($element-class) { | |
#{_block-name(&) + $element-class} { | |
@content; | |
} |
NewerOlder