little-state-machine
Advanced tools
Comparing version 2.3.1 to 2.3.2
@@ -6,2 +6,3 @@ import * as React from 'react'; | ||
let storageType = window.sessionStorage; | ||
const STATE_MACHINE_DEBUG_NAME = '__STATE_MACHINE_DEBUG__'; | ||
function setStorageType(type) { | ||
@@ -11,3 +12,3 @@ storageType = type; | ||
function storeFactory() { | ||
let storeName = 'SESSION_LITTLE_STATE_MACHINE'; | ||
let storeName = '__LITTLE_STATE_MACHINE__'; | ||
const sessionStorageData = storageType.getItem(storeName); | ||
@@ -57,3 +58,3 @@ let store = sessionStorageData ? JSON.parse(sessionStorageData) : {}; | ||
const cloneDeep = require('lodash.clonedeep'); | ||
debug = storageType.getItem('__STATE_MACHINE_DEBUG') === 'true'; | ||
debug = storageType.getItem(STATE_MACHINE_DEBUG_NAME) === 'true'; | ||
if (debug) { | ||
@@ -83,3 +84,3 @@ console.log(`%c${key ? options.debugName[key] : options.debugName}`, 'color: #bada55'); | ||
window.LITTLE_STATE_MACHINE_DEBUG = (value) => { | ||
storageType.setItem('__STATE_MACHINE_DEBUG', value); | ||
storageType.setItem(STATE_MACHINE_DEBUG_NAME, value); | ||
}; | ||
@@ -86,0 +87,0 @@ } |
@@ -9,2 +9,3 @@ 'use strict'; | ||
let storageType = window.sessionStorage; | ||
const STATE_MACHINE_DEBUG_NAME = '__STATE_MACHINE_DEBUG__'; | ||
function setStorageType(type) { | ||
@@ -14,3 +15,3 @@ storageType = type; | ||
function storeFactory() { | ||
let storeName = 'SESSION_LITTLE_STATE_MACHINE'; | ||
let storeName = '__LITTLE_STATE_MACHINE__'; | ||
const sessionStorageData = storageType.getItem(storeName); | ||
@@ -60,3 +61,3 @@ let store = sessionStorageData ? JSON.parse(sessionStorageData) : {}; | ||
const cloneDeep = require('lodash.clonedeep'); | ||
debug = storageType.getItem('__STATE_MACHINE_DEBUG') === 'true'; | ||
debug = storageType.getItem(STATE_MACHINE_DEBUG_NAME) === 'true'; | ||
if (debug) { | ||
@@ -86,3 +87,3 @@ console.log(`%c${key ? options.debugName[key] : options.debugName}`, 'color: #bada55'); | ||
window.LITTLE_STATE_MACHINE_DEBUG = (value) => { | ||
storageType.setItem('__STATE_MACHINE_DEBUG', value); | ||
storageType.setItem(STATE_MACHINE_DEBUG_NAME, value); | ||
}; | ||
@@ -89,0 +90,0 @@ } |
{ | ||
"name": "little-state-machine", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.es.js", |
180229
273