@swear-js/core
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9533