createShadowFactory() function
Home > @rimitive/view > createShadowFactory
createShadowFactory() function
Section titled “createShadowFactory() function”Create a shadow factory with the given dependencies.
Signature:
export declare function createShadowFactory<TConfig extends TreeConfig>({ scopedEffect, onCleanup, adapter, }: ShadowOpts<TConfig>): ShadowService<NodeOf<TConfig>>;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
{ scopedEffect, onCleanup, adapter, } |
ShadowOpts<TConfig> |
Returns:
ShadowService<NodeOf<TConfig>>
Example
Section titled “Example”const shadow = createShadowFactory({ adapter, scopedEffect, onCleanup });
el('div')( shadow({ mode: 'open', styles: css })( el('p')('Isolated content') ))