Skip to content

Instantly share code, notes, and snippets.

Avatar

Illia Kolodiazhnyi iktash

  • Dublin, Ireland
View GitHub Profile
@iktash
iktash / functionalDispatch.js
Created Oct 22, 2018
A tiny example of an application state management done in a fully functional manner
View functionalDispatch.js
const getDispatch = (initialState, render) => {
let stateContainer = Container.of(initialState);
const updateState = action => new IO(() => {
stateContainer = stateContainer.map(action);
return stateContainer;
});
return action => {
const sideEffects = pipe(
View GithubApiPush.js
//Uses the https://github.com/github-tools/github library under the hood and exposes it as `gh` property
function GithubAPI(auth) {
let repo;
let filesToCommit = [];
let currentBranch = {};
let newCommit = {};
//the underlying library for making requests
let gh = new GitHub(auth);
You can’t perform that action at this time.