Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@swear-js/core

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swear-js/core - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

4

lib/createStore.js

@@ -32,3 +32,3 @@ "use strict";

getSwearValue: function (swearId) { return store[swearId]; },
setSwearValue: function (swearId, actionType, payload) {
setSwearValue: function (swearId, tag, payload) {
if (store[swearId] !== payload) {

@@ -43,3 +43,3 @@ var prev = __assign({}, store);

swearId: swearId,
actionType: actionType,
tag: tag,
prev: prev,

@@ -46,0 +46,0 @@ payload: payload,

@@ -5,3 +5,3 @@ export declare type SwearStoreType<T> = Record<string, T>;

swearId: SwearId;
actionType: string;
tag: string | null;
prev: any;

@@ -24,5 +24,5 @@ payload: any;

getSwearValue: <T>(swearId: string) => T;
setSwearValue: <T>(swearId: string, actionType: string, payload: T) => void;
setSwearValue: <T>(swearId: string, tag: SwearPatch['tag'], payload: T) => void;
subscribe: <T>(swear: SwearRegisterSubscribeArgs<T>) => void;
unsubscribe: (swearId: SwearId) => void;
};
{
"name": "@swear-js/core",
"version": "2.0.0",
"version": "2.1.0",
"description": "Simple observer state manager",

@@ -47,3 +47,3 @@ "repository": {

},
"gitHead": "5c84fd2d51fe5b6611c52f55c4ce27b22061030e"
"gitHead": "ac4163c86f8f39d83f6cb172f6e7bb40cc7791b5"
}

@@ -83,3 +83,3 @@ # 🍭 Swear JS

swearId, // String value which gets a name of patched swear state
actionType, // String value which gets a name of a dispatched action
tag, // String value which gets an optional tag, you want to set
prev, // Previous store state (object)

@@ -95,4 +95,4 @@ payload, // Payload passed

const logger = ({ swearId, actionType, prev, payload, next }: SwearPatch) => {
console.log(`Swear: ${swearId}, Action: ${actionType}, Payload: ${payload}`);
const logger = ({ swearId, tag, prev, payload, next }: SwearPatch) => {
console.log(`Swear: ${swearId}, Tag: ${tag}, Payload: ${payload}`);
console.log(`Previous state: ${prev}`, `Current state: ${next}`);

@@ -99,0 +99,0 @@ };

Sorry, the diff of this file is not supported yet

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