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

brisky-struct

Package Overview
Dependencies
Maintainers
1
Versions
397
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brisky-struct - npm Package Compare versions

Comparing version 0.0.22 to 0.0.23

test/subscribe/switch/references.js

15

lib/subscribe/switch.js
const { diff } = require('./diff')
const remove = require('./property/remove')
const { update } = require('./property')
const { origin } = require('../compute')

@@ -42,2 +43,3 @@ const driver = (t, type) => {}

const branch = tree[key] = { _p: tree, _key: key, $subs: subs }
if (origin(t) !== t) { tree[key].$origin = origin(t) }
return diff(t, subs, cb, branch, void 0, composite)

@@ -60,3 +62,3 @@ }

return true
} else if (isSwitched(branch.$subs, result)) {
} else if (isSwitched(branch.$subs, result, branch, t)) {
remove(branch.$subs, cb, branch)

@@ -72,3 +74,12 @@ update(key, t, result, cb, tree, void 0, composite)

const isSwitched = (a, b) => {
const isSwitched = (a, b, branch, t) => {
if (t) {
let o = origin(t)
let b = branch.$origin
if (b && b !== o || o !== t) {
branch.$origin = o
return true
}
}
if (a === b) {

@@ -75,0 +86,0 @@ return false // test

2

package.json
{
"name": "brisky-struct",
"description": "An observable data structure",
"version": "0.0.22",
"version": "0.0.23",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "scripts": {

@@ -14,4 +14,4 @@ require('./types')

require('./context')
require('./subscribe')
require('./props')
require('./async')
require('./subscribe')
require('./basic')
require('./remove')
require('./any')
require('./references')
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