@wix/site-service-above-the-fold
v1.0.2
Published
Service for checking whether a component id/path is marked as above the fold.
Downloads
217
Maintainers
Keywords
Readme
@wix/site-service-above-the-fold
Service for checking whether a component id/path is marked as above the fold.
Install
yarn add @wix/site-service-above-the-foldUsage
import { AboveTheFoldDefinition } from '@wix/site-service-above-the-fold/definition'
import { AboveTheFoldService } from '@wix/site-service-above-the-fold/implementations'
createServicesMap().addService(AboveTheFoldDefinition, AboveTheFoldService, config)
const service = servicesManager.getService(AboveTheFoldDefinition)
const isAboveTheFold = service.isInFirstFold('comp-k4x3')API
| Member | Type | Throws when | Description |
|---|---|---|---|
| isInFirstFold | (key: CompId \| CompPath) => boolean \| undefined | never | Returns whether the passed component id/path is marked as above-the-fold in config. |
Configuration
IAboveTheFoldServiceConfig:
type CompId = string
type CompPath = string
type IAboveTheFoldServiceConfig = Record<CompId | CompPath, boolean>When a key does not exist in config, isInFirstFold returns undefined.
Reactivity
This is a read-only lookup service and does not expose runtime update APIs.
