Skip to content

Instantly share code, notes, and snippets.

Avatar

Robert Valmassoi valmassoi

View GitHub Profile
@valmassoi
valmassoi / getState.rule.json
Created Jan 15, 2020
eslint disallow getState
View getState.rule.json
"no-restricted-syntax": [
"error",
{
"selector": "CallExpression[callee.name='getState']",
"message": "Actions must be kept pure. Pass in the needed piece of state as a param."
}
]
@valmassoi
valmassoi / chain.js
Created Jan 7, 2020
chain functions like jQuery
View chain.js
const chain = {
first: () => {
console.log(1);
return chain;
},
third: function() { // cant use fat arrow, binds this
console.log(3);
return this;
},
second: () => {
@valmassoi
valmassoi / createStore.js
Created Jan 7, 2020
redux createStore from scratch
View createStore.js
// https://egghead.io/lessons/react-redux-implementing-store-from-scratch
const createStore = (reducer) => {
let state;
let listeners = [];
const getState = () => state;
const dispatch = (action) => {
// calculate new state
View keybase.md

Keybase proof

I hereby claim:

  • I am valmassoi on github.
  • I am valmassoi (https://keybase.io/valmassoi) on keybase.
  • I have a public key ASCTZ4fnmhX2myb0nKI1oYUVO_fcS4XgWmBUKV-oHdOVeAo

To claim this, I am signing this object:

View One Name Verify
Verifying that +valmassoi is my blockchain ID. https://onename.com/valmassoi