Skip to content

Instantly share code, notes, and snippets.

View mimol91's full-sized avatar

Adam Szaraniec mimol91

View GitHub Profile
@mimol91
mimol91 / map rand.js
Last active November 23, 2016 10:43
map rand
const shipConfig = [
[4],
[3],
[2],
[1],
[1],
[1],
[1]
];
@mimol91
mimol91 / README.MD
Last active September 18, 2016 20:40
HAL + SPA

HAL + SPA

Technology
  • React - A JavaScript library for building user interfaces
  • Redux - RESTful HTTP client for JavaScript
  • Rest - Predictable state container for JavaScript apps

Introduction

React containers should be self aware and be able to fetch required data to pass it to components. Using HAL may cause to send multiple request to obtain this same data. This document shows possible solutions how this can be solved.

@mimol91
mimol91 / rest.js
Created September 12, 2016 19:21
rest
import rest from 'rest'
import hateoas from 'rest/interceptor/hateoas'
import mime from 'rest/interceptor/mime'
import interceptor from 'rest/interceptor'
import defaultRequest from 'rest/interceptor/defaultRequest'
import errorCode from 'rest/interceptor/errorCode'
const tokenRemoval = interceptor({
response: (response, config, meta) => {
if (response.status.code === 401) {