2.0.17 • Published 3 months ago

@solid-primitives/page-visibility v2.0.17

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

@solid-primitives/page-visibility

turborepo size size stage

Installation

npm install @solid-primitives/page-visibility
# or
yarn add @solid-primitives/page-visibility

createPageVisibility

Creates a signal with a boolean value identifying the page visibility state.

How to use it

import { createPageVisibility } from "@solid-primitives/page-visibility";

const visible = createPageVisibility();

createEffect(() => {
  visible(); // => boolean
});

usePageVisibility

usePageVisibility is a singleton root primitive. It is providing the same signal as createPageVisibility, but the event-listener and the signal are shared between dependents, making it more optimized to use in multiple places at once.

How to use it

import { usePageVisibility } from "@solid-primitives/page-visibility";

const visible = usePageVisibility();

createEffect(() => {
  visible(); // => boolean
});

Changelog

See CHANGELOG.md

2.0.17

3 months ago

2.0.16

3 months ago

2.0.15

4 months ago

2.0.13

10 months ago

2.0.14

9 months ago

2.0.11

1 year ago

2.0.12

1 year ago

2.0.10

1 year ago

2.0.6-beta.0

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.3

1 year ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago