Skip to content

createShadowFactory() function

Home > @rimitive/view > createShadowFactory

Create a shadow factory with the given dependencies.

Signature:

export declare function createShadowFactory<TConfig extends TreeConfig>({ scopedEffect, onCleanup, adapter, }: ShadowOpts<TConfig>): ShadowService<NodeOf<TConfig>>;

Parameter

Type

Description

{ scopedEffect, onCleanup, adapter, }

ShadowOpts<TConfig>

Returns:

ShadowService<NodeOf<TConfig>>

const shadow = createShadowFactory({ adapter, scopedEffect, onCleanup });
el('div')(
shadow({ mode: 'open', styles: css })(
el('p')('Isolated content')
)
)