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

haunted

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

haunted - npm Package Compare versions

Comparing version 4.1.2 to 4.1.3

21

haunted.js

@@ -122,15 +122,8 @@ import { render, directive } from 'https://unpkg.com/lit-html@^1.0.0/lit-html.js';

teardown() {
let effects = this[effectsSymbol];
if(effects) {
for(let effect of effects) {
effect.teardown();
let hooks = this[hookSymbol];
hooks.forEach((hook) => {
if (typeof hook.teardown === 'function') {
hook.teardown();
}
}
let contexts = this[contextSymbol];
if(contexts) {
for(let context of contexts) {
context.unsubscribe();
}
}
});
}

@@ -437,3 +430,3 @@ }

unsubscribe() {
teardown() {
if (this._unsubscribe) {

@@ -501,2 +494,2 @@ this._unsubscribe();

export { component, useCallback, useEffect, useState, useReducer, useMemo, withHooks, withHooks as virtual, useContext, createContext };
export { component, useCallback, useEffect, useState, useReducer, useMemo, withHooks, withHooks as virtual, useContext, createContext, hook, Hook };

@@ -122,15 +122,8 @@ import { render, directive } from 'lit-html';

teardown() {
let effects = this[effectsSymbol];
if(effects) {
for(let effect of effects) {
effect.teardown();
let hooks = this[hookSymbol];
hooks.forEach((hook) => {
if (typeof hook.teardown === 'function') {
hook.teardown();
}
}
let contexts = this[contextSymbol];
if(contexts) {
for(let context of contexts) {
context.unsubscribe();
}
}
});
}

@@ -437,3 +430,3 @@ }

unsubscribe() {
teardown() {
if (this._unsubscribe) {

@@ -501,2 +494,2 @@ this._unsubscribe();

export { component, useCallback, useEffect, useState, useReducer, useMemo, withHooks, withHooks as virtual, useContext, createContext };
export { component, useCallback, useEffect, useState, useReducer, useMemo, withHooks, withHooks as virtual, useContext, createContext, hook, Hook };
{
"name": "haunted",
"version": "4.1.2",
"version": "4.1.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -372,2 +372,22 @@ # Haunted 🦇 🎃

#### Write Your Own Hook
Most functionality can be achieved with the provided hooks above, but you can also create your own hooks for custom functionality.
```html
import { hook, Hook } from 'haunted';
const useMyHook = hook(class extends Hook {
constructor(id, el) {
super(id, el);
...
}
update() { ... }
teardown() { ... }
});
```
### Function Signatures

@@ -374,0 +394,0 @@

@@ -1,3 +0,3 @@

import { render, directive } from '../node_modules/lit-html/lit-html.js';
export { html, render } from '../node_modules/lit-html/lit-html.js';
import { render, directive } from '../lit-html/lit-html.js';
export { html, render } from '../lit-html/lit-html.js';

@@ -122,15 +122,8 @@ const symbolFor = typeof Symbol === 'function' ? Symbol.for : str => str;

teardown() {
let effects = this[effectsSymbol];
if(effects) {
for(let effect of effects) {
effect.teardown();
let hooks = this[hookSymbol];
hooks.forEach((hook) => {
if (typeof hook.teardown === 'function') {
hook.teardown();
}
}
let contexts = this[contextSymbol];
if(contexts) {
for(let context of contexts) {
context.unsubscribe();
}
}
});
}

@@ -437,3 +430,3 @@ }

unsubscribe() {
teardown() {
if (this._unsubscribe) {

@@ -501,2 +494,2 @@ this._unsubscribe();

export { component, useCallback, useEffect, useState, useReducer, useMemo, withHooks, withHooks as virtual, useContext, createContext };
export { component, useCallback, useEffect, useState, useReducer, useMemo, withHooks, withHooks as virtual, useContext, createContext, hook, Hook };
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