Comparing version 4.5.3 to 4.5.4
@@ -59,3 +59,3 @@ import { directive, render } from 'https://unpkg.com/lit-html@^1.0.0/lit-html.js'; | ||
function makeContainer(render$$1) { | ||
function makeContainer(render) { | ||
const read = scheduler(); | ||
@@ -103,3 +103,3 @@ const write = scheduler(); | ||
commit(result) { | ||
render$$1(result, this.frag); | ||
render(result, this.frag); | ||
this.runEffects(commitSymbol); | ||
@@ -418,6 +418,6 @@ } | ||
Consumer: component(function ({ render: render$$1 }) { | ||
Consumer: component(function ({ render }) { | ||
const context = useContext(Context); | ||
return render$$1(context); | ||
return render(context); | ||
}), | ||
@@ -512,4 +512,4 @@ | ||
function haunted({ render: render$$1 }) { | ||
const Container = makeContainer(render$$1); | ||
function haunted({ render }) { | ||
const Container = makeContainer(render); | ||
const component = makeComponent(Container); | ||
@@ -598,2 +598,2 @@ const createContext = makeContext(component); | ||
export default haunted; | ||
export { component, createContext, virtual, useCallback, useEffect, useState, useReducer, useMemo, useContext, useRef, hook, Hook }; | ||
export { Hook, component, createContext, hook, useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState, virtual }; |
@@ -10,6 +10,3 @@ import { html, render, TemplateResult } from 'lit-html'; | ||
useShadowDOM: boolean, | ||
shadowRootInit?: { | ||
mode?: string | ||
delegatesFocus?: boolean, | ||
} | ||
shadowRootInit?: ShadowRootInit, | ||
} | ||
@@ -54,3 +51,3 @@ | ||
interface HookWithLifecycle<T extends ComponentLike = HTMLElement, P extends any[] = null, R = void> extends Hook<T> { | ||
interface HookWithLifecycle<T extends ComponentLike = HTMLElement, P extends any[] = [], R = void> extends Hook<T> { | ||
update?(...args: P): R; | ||
@@ -57,0 +54,0 @@ teardown?(): void; |
{ | ||
"name": "haunted", | ||
"version": "4.5.3", | ||
"version": "4.5.4", | ||
"description": "Hooks for web components", | ||
@@ -31,3 +31,3 @@ "main": "lib/haunted.js", | ||
"homepage": "https://github.com/matthewp/haunted#readme", | ||
"typings": " lib/haunted.d.ts", | ||
"typings": "lib/haunted.d.ts", | ||
"devDependencies": { | ||
@@ -34,0 +34,0 @@ "@matthewp/compile": "^2.4.3", |
# Haunted 🦇 🎃 | ||
[![npm](https://img.shields.io/npm/dt/haunted)](https://npm.im/haunted) | ||
[![npm](https://img.shields.io/npm/v/haunted)](https://npm.im/haunted) | ||
React's Hooks API but for standard web components and [lit-html](https://lit-html.polymer-project.org/) or [hyperHTML](https://codepen.io/WebReflection/pen/pxXrdy?editors=0010). | ||
@@ -4,0 +7,0 @@ |
14
web.js
@@ -59,3 +59,3 @@ import { directive, render } from '../lit-html/lit-html.js'; | ||
function makeContainer(render$$1) { | ||
function makeContainer(render) { | ||
const read = scheduler(); | ||
@@ -103,3 +103,3 @@ const write = scheduler(); | ||
commit(result) { | ||
render$$1(result, this.frag); | ||
render(result, this.frag); | ||
this.runEffects(commitSymbol); | ||
@@ -418,6 +418,6 @@ } | ||
Consumer: component(function ({ render: render$$1 }) { | ||
Consumer: component(function ({ render }) { | ||
const context = useContext(Context); | ||
return render$$1(context); | ||
return render(context); | ||
}), | ||
@@ -512,4 +512,4 @@ | ||
function haunted({ render: render$$1 }) { | ||
const Container = makeContainer(render$$1); | ||
function haunted({ render }) { | ||
const Container = makeContainer(render); | ||
const component = makeComponent(Container); | ||
@@ -598,2 +598,2 @@ const createContext = makeContext(component); | ||
export default haunted; | ||
export { component, createContext, virtual, useCallback, useEffect, useState, useReducer, useMemo, useContext, useRef, hook, Hook }; | ||
export { Hook, component, createContext, hook, useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState, virtual }; |
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
59457
491
1545