(
create:
| Layer.Layer<R, E, AtomRegistry | Reactivity.Reactivity>
| ((get: AtomContext) => Layer.Layer<R, E, AtomRegistry | Reactivity.Reactivity>)
)
| 726 | readonly memoMap: Atom<Layer.MemoMap> |
| 727 | } |
| 728 | |
| 729 | /** |
| 730 | * A `RuntimeFactory` backed by a concrete memo map shared across registries. |
| 731 | * |
| 732 | * @category models |
| 733 | * @since 4.0.0 |
| 734 | */ |
| 735 | export interface SharedRuntimeFactory extends RuntimeFactory { |
| 736 | readonly memoMap: Layer.MemoMap |
| 737 | } |
| 738 | |
| 739 | /** |
| 740 | * Creates a `RuntimeFactory` backed by a registry-scoped memo map by default, |
| 741 | * or by the supplied atom or concrete `Layer.MemoMap`. |
| 742 | * |
| 743 | * @category constructors |
| 744 | * @since 4.0.0 |
| 745 | */ |
| 746 | export function context(): RegistryRuntimeFactory |
| 747 | export function context(options: { readonly memoMap: Atom<Layer.MemoMap> }): RegistryRuntimeFactory |
| 748 | export function context(options: { readonly memoMap: Layer.MemoMap }): SharedRuntimeFactory |
| 749 | export function context(options?: { |
| 750 | readonly memoMap: Atom<Layer.MemoMap> | Layer.MemoMap |
| 751 | }): RegistryRuntimeFactory | SharedRuntimeFactory { |
| 752 | const memoMap = options?.memoMap ?? removeTtl(make(() => Layer.makeMemoMapUnsafe())) |
| 753 | const resolveMemoMap = (get: AtomContext): Layer.MemoMap => isAtom(memoMap) ? get(memoMap) : memoMap |
| 754 | let globalLayer: Layer.Layer<any, any, AtomRegistry> = Reactivity.layer |
| 755 | function factory<E, R>( |
| 756 | create: |
no test coverage detected
searching dependent graphs…