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 INIT = '@redux/INIT'; | |
export const createStore = (reducer, state, enhancer) => { | |
if (enhancer) { | |
return enhancer(createStore)(reducer, state); | |
} | |
const subscribers = []; | |
dispatch({ type: INIT }); |
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 numpy as np | |
import hashlib | |
def create_block(parent_block, value, hashfunc): | |
""" ------------------------------------------------ | |
String -> Block -> (Block -> String) -> Block | |
------------------------------------------------ | |
Produce a new block from a string value and a hash | |
of its parent block. In this case, a block is also a string. | |
""" |