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

dot-store

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dot-store - npm Package Compare versions

Comparing version 0.9.3 to 0.9.4

49

dist/index.js

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

this.listeners = {};
this.listenersByProps = {};
this.listenersByProp = {};
this.state = state;

@@ -115,4 +115,4 @@

key: "getSync",
value: function getSync(props) {
return _camelDotPropImmutable2.default.get(this.state, props);
value: function getSync(prop) {
return _camelDotPropImmutable2.default.get(this.state, prop);
}

@@ -207,7 +207,7 @@ }, {

}, {
key: "addListenerByProps",
value: function addListenerByProps(props, listener) {
this.listenersByProps[props] = this.listenersByProps[props] || [];
key: "addListenerByProp",
value: function addListenerByProp(prop, listener) {
this.listenersByProp[prop] = this.listenersByProp[prop] || [];
this.listenersByProps[props] = this.listenersByProps[props].concat([listener]);
this.listenersByProp[prop] = this.listenersByProp[prop].concat([listener]);
}

@@ -414,7 +414,7 @@ }, {

key: "on",
value: function on(props, fn) {
value: function on(prop, fn) {
var listener = function listener(options) {
var detectChange = options.detectChange;
if (detectChange(props)) {
if (detectChange(prop)) {
fn(options);

@@ -424,3 +424,3 @@ }

this.addListenerByProps(props, listener);
this.addListenerByProps(prop, listener);
this.subscribe(listener);

@@ -432,6 +432,6 @@

key: "off",
value: function off(props) {
var listeners = this.listenersByProps[props];
value: function off(prop) {
var listeners = this.listenersByProp[prop];
this.listenersByProps[props] = [];
this.listenersByProp[prop] = [];

@@ -467,3 +467,3 @@ var _iteratorNormalCompletion4 = true;

key: "once",
value: function once(props, fn) {
value: function once(prop, fn) {
var ran = false;

@@ -479,3 +479,3 @@

if (detectChange(props)) {
if (detectChange(prop)) {
ran = true;

@@ -486,3 +486,3 @@ fn(options);

this.addListenerByProps(props, listener);
this.addListenerByProps(prop, listener);
this.subscribe(listener);

@@ -492,2 +492,19 @@

}
}, {
key: "oncePresent",
value: function oncePresent(prop, fn) {
var value = this.getSync(prop);
if (value) {
fn({
prop: prop,
props: (0, _string.propSplit)(prop),
state: this.state,
store: this,
value: value
});
} else {
this.once(prop, fn);
}
}
}]);

@@ -494,0 +511,0 @@ return DotStore;

{
"name": "dot-store",
"version": "0.9.3",
"version": "0.9.4",
"description": "Like Redux, but easy",

@@ -5,0 +5,0 @@ "keywords": [

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