Comparing version 4.6.1 to 4.6.2
@@ -265,3 +265,3 @@ import { directive, render } from 'https://unpkg.com/lit-html@^1.0.0/lit-html.js'; | ||
teardown() { | ||
if (this._teardown) { | ||
if (typeof this._teardown === 'function') { | ||
this._teardown(); | ||
@@ -268,0 +268,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { BaseScheduler } from './scheduler.js'; | ||
import { BaseScheduler } from './scheduler'; | ||
const toCamelCase = (val = '') => val.replace(/-+([a-z])?/g, (_, char) => char ? char.toUpperCase() : ''); | ||
@@ -3,0 +3,0 @@ function makeComponent(render) { |
@@ -1,3 +0,3 @@ | ||
import { makeComponent } from './component.js'; | ||
import { makeContext } from './create-context.js'; | ||
import { makeComponent } from './component'; | ||
import { makeContext } from './create-context'; | ||
function haunted({ render }) { | ||
@@ -9,12 +9,12 @@ const component = makeComponent(render); | ||
export { haunted as default }; | ||
export { useCallback } from './use-callback.js'; | ||
export { useEffect } from './use-effect.js'; | ||
export { useLayoutEffect } from './use-layout-effect.js'; | ||
export { useState } from './use-state.js'; | ||
export { useReducer } from './use-reducer.js'; | ||
export { useMemo } from './use-memo.js'; | ||
export { useContext } from './use-context.js'; | ||
export { useRef } from './use-ref.js'; | ||
export { hook, Hook } from './hook.js'; | ||
export { BaseScheduler } from './scheduler.js'; | ||
export { State } from './state.js'; | ||
export { useCallback } from './use-callback'; | ||
export { useEffect } from './use-effect'; | ||
export { useLayoutEffect } from './use-layout-effect'; | ||
export { useState } from './use-state'; | ||
export { useReducer } from './use-reducer'; | ||
export { useMemo } from './use-memo'; | ||
export { useContext } from './use-context'; | ||
export { useRef } from './use-ref'; | ||
export { hook, Hook } from './hook'; | ||
export { BaseScheduler } from './scheduler'; | ||
export { State } from './state'; |
@@ -1,3 +0,3 @@ | ||
import { contextEvent } from './symbols.js'; | ||
import { useContext } from './use-context.js'; | ||
import { contextEvent } from './symbols'; | ||
import { useContext } from './use-context'; | ||
function makeContext(component) { | ||
@@ -4,0 +4,0 @@ return (defaultValue) => { |
@@ -1,2 +0,2 @@ | ||
import { Hook, hook } from './hook.js'; | ||
import { Hook, hook } from './hook'; | ||
function createEffect(setEffects) { | ||
@@ -23,3 +23,3 @@ return hook(class extends Hook { | ||
teardown() { | ||
if (this._teardown) { | ||
if (typeof this._teardown === 'function') { | ||
this._teardown(); | ||
@@ -26,0 +26,0 @@ } |
@@ -1,3 +0,3 @@ | ||
export { html, render, component, createContext, virtual } from './lit-haunted.js'; | ||
export * from './core.js'; | ||
export { default } from './core.js'; | ||
export { html, render, component, createContext, virtual } from './lit-haunted'; | ||
export * from './core'; | ||
export { default } from './core'; |
@@ -1,3 +0,3 @@ | ||
import { current, notify } from './interface.js'; | ||
import { hookSymbol } from './symbols.js'; | ||
import { current, notify } from './interface'; | ||
import { hookSymbol } from './symbols'; | ||
class Hook { | ||
@@ -4,0 +4,0 @@ constructor(id, state) { |
import { html, render } from 'lit-html'; | ||
import haunted from './core.js'; | ||
import { makeVirtual } from './virtual.js'; | ||
import haunted from './core'; | ||
import { makeVirtual } from './virtual'; | ||
const { component, createContext } = haunted({ render }); | ||
const virtual = makeVirtual(); | ||
export { component, createContext, virtual, html, render }; |
@@ -1,3 +0,3 @@ | ||
import { State } from './state.js'; | ||
import { commitSymbol, phaseSymbol, updateSymbol, effectsSymbol, layoutEffectsSymbol } from './symbols.js'; | ||
import { State } from './state'; | ||
import { commitSymbol, phaseSymbol, updateSymbol, effectsSymbol, layoutEffectsSymbol } from './symbols'; | ||
const defer = Promise.resolve().then.bind(Promise.resolve()); | ||
@@ -4,0 +4,0 @@ function runner() { |
@@ -1,3 +0,3 @@ | ||
import { setCurrent, clear } from './interface.js'; | ||
import { hookSymbol, effectsSymbol, layoutEffectsSymbol } from './symbols.js'; | ||
import { setCurrent, clear } from './interface'; | ||
import { hookSymbol, effectsSymbol, layoutEffectsSymbol } from './symbols'; | ||
class State { | ||
@@ -4,0 +4,0 @@ constructor(update, host) { |
@@ -1,3 +0,3 @@ | ||
import { useMemo } from './use-memo.js'; | ||
import { useMemo } from './use-memo'; | ||
const useCallback = (fn, inputs) => useMemo(() => fn, inputs); | ||
export { useCallback }; |
@@ -1,4 +0,4 @@ | ||
import { hook, Hook } from './hook.js'; | ||
import { contextEvent } from './symbols.js'; | ||
import { setEffects } from './use-effect.js'; | ||
import { hook, Hook } from './hook'; | ||
import { contextEvent } from './symbols'; | ||
import { setEffects } from './use-effect'; | ||
const useContext = hook(class extends Hook { | ||
@@ -5,0 +5,0 @@ constructor(id, state, _) { |
@@ -1,3 +0,3 @@ | ||
import { effectsSymbol } from './symbols.js'; | ||
import { createEffect } from './create-effect.js'; | ||
import { effectsSymbol } from './symbols'; | ||
import { createEffect } from './create-effect'; | ||
function setEffects(state, cb) { | ||
@@ -4,0 +4,0 @@ state[effectsSymbol].push(cb); |
@@ -1,3 +0,3 @@ | ||
import { layoutEffectsSymbol } from './symbols.js'; | ||
import { createEffect } from './create-effect.js'; | ||
import { layoutEffectsSymbol } from './symbols'; | ||
import { createEffect } from './create-effect'; | ||
function setLayoutEffects(state, cb) { | ||
@@ -4,0 +4,0 @@ state[layoutEffectsSymbol].push(cb); |
@@ -1,2 +0,2 @@ | ||
import { hook, Hook } from './hook.js'; | ||
import { hook, Hook } from './hook'; | ||
const useMemo = hook(class extends Hook { | ||
@@ -3,0 +3,0 @@ constructor(id, state, fn, values) { |
@@ -1,2 +0,2 @@ | ||
import { hook, Hook } from './hook.js'; | ||
import { hook, Hook } from './hook'; | ||
const useReducer = hook(class extends Hook { | ||
@@ -3,0 +3,0 @@ constructor(id, state, _, initialState) { |
@@ -1,2 +0,2 @@ | ||
import { useMemo } from './use-memo.js'; | ||
import { useMemo } from './use-memo'; | ||
const useRef = (initialValue) => useMemo(() => ({ | ||
@@ -3,0 +3,0 @@ current: initialValue |
@@ -1,2 +0,2 @@ | ||
import { hook, Hook } from './hook.js'; | ||
import { hook, Hook } from './hook'; | ||
const useState = hook(class extends Hook { | ||
@@ -3,0 +3,0 @@ constructor(id, state, initialValue) { |
import { directive } from 'lit-html'; | ||
import { BaseScheduler } from './scheduler.js'; | ||
import { BaseScheduler } from './scheduler'; | ||
const includes = Array.prototype.includes; | ||
@@ -4,0 +4,0 @@ function makeVirtual() { |
{ | ||
"name": "haunted", | ||
"version": "4.6.1", | ||
"version": "4.6.2", | ||
"description": "Hooks for web components", | ||
@@ -5,0 +5,0 @@ "main": "lib/haunted.js", |
@@ -265,3 +265,3 @@ import { directive, render } from '../lit-html/lit-html.js'; | ||
teardown() { | ||
if (this._teardown) { | ||
if (typeof this._teardown === 'function') { | ||
this._teardown(); | ||
@@ -268,0 +268,0 @@ } |
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
74295