Socket
Socket
Sign inDemoInstall

little-state-machine

Package Overview
Dependencies
Maintainers
1
Versions
210
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

little-state-machine - npm Package Compare versions

Comparing version 2.3.2 to 2.3.3

.rpt2_cache/rpt2_ddf57ed422ef2560bada0bf5c5cc05f5632a8818/code/cache/64077684b6948df9f2f271650b9a59828943b43d

4

dist/index.d.ts
import * as React from 'react';
declare let setStorageName: any;
export declare function setStorageType(type: any): void;
declare const setStorageName: (name: any) => void;
export declare function createStore(data: any): void;
export { setStorageName };
export declare function createStore(data: any): void;
export declare const StateMachineContext: React.Context<{

@@ -7,0 +7,0 @@ store: {};

@@ -6,2 +6,6 @@ import * as React from 'react';

let storageType = window.sessionStorage;
let get;
let set;
let getName;
let setStorageName;
const STATE_MACHINE_DEBUG_NAME = '__STATE_MACHINE_DEBUG__';

@@ -32,4 +36,8 @@ function setStorageType(type) {

}
const { setName: setStorageName, getName, get, set } = storeFactory();
function createStore(data) {
const factoryResult = storeFactory();
setStorageName = factoryResult.setName;
getName = factoryResult.getName;
get = factoryResult.get;
set = factoryResult.set;
const result = get();

@@ -90,3 +98,9 @@ if (result && Object.keys(result).length)

? Object.entries(callbacks).reduce((previous, [key, callback]) => {
previous[key] = actionTemplate({ options, callback, updateStore, globalState, key });
previous[key] = actionTemplate({
options,
callback,
updateStore,
globalState,
key,
});
return previous;

@@ -101,3 +115,10 @@ }, {})

actions: {},
action: callbacks ? actionTemplate({ options, callback: callbacks, updateStore, globalState }) : () => { },
action: callbacks
? actionTemplate({
options,
callback: callbacks,
updateStore,
globalState,
})
: () => { },
state: globalState,

@@ -104,0 +125,0 @@ };

@@ -9,2 +9,6 @@ 'use strict';

let storageType = window.sessionStorage;
let get;
let set;
let getName;
const STATE_MACHINE_DEBUG_NAME = '__STATE_MACHINE_DEBUG__';

@@ -35,4 +39,8 @@ function setStorageType(type) {

}
const { setName: setStorageName, getName, get, set } = storeFactory();
function createStore(data) {
const factoryResult = storeFactory();
exports.setStorageName = factoryResult.setName;
getName = factoryResult.getName;
get = factoryResult.get;
set = factoryResult.set;
const result = get();

@@ -93,3 +101,9 @@ if (result && Object.keys(result).length)

? Object.entries(callbacks).reduce((previous, [key, callback]) => {
previous[key] = actionTemplate({ options, callback, updateStore, globalState, key });
previous[key] = actionTemplate({
options,
callback,
updateStore,
globalState,
key,
});
return previous;

@@ -104,3 +118,10 @@ }, {})

actions: {},
action: callbacks ? actionTemplate({ options, callback: callbacks, updateStore, globalState }) : () => { },
action: callbacks
? actionTemplate({
options,
callback: callbacks,
updateStore,
globalState,
})
: () => { },
state: globalState,

@@ -113,4 +134,3 @@ };

exports.createStore = createStore;
exports.setStorageName = setStorageName;
exports.setStorageType = setStorageType;
exports.useStateMachine = useStateMachine;
{
"name": "little-state-machine",
"version": "2.3.2",
"version": "2.3.3",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "module": "dist/index.es.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc