# RefTrie.longestPrefixOf

Get the longest prefix of a key that exists in the Trie.

## Signatures

```ts
export declare const longestPrefixOf: {
    (key: string): <V, E, R>(ref: RefTrie<V, E, R>) => RefSubject.Computed<[
        string,
        V
    ] | undefined, E, R>;
    <V, E, R>(ref: RefTrie<V, E, R>, key: string): RefSubject.Computed<[
        string,
        V
    ] | undefined, E, R>;
};
```

## Why

Models a longest-prefix lookup as Filtered state: an absent match fails an Effect read with
`NoSuchElementError`, while later pushes can make a match available.

## Ownership and lifetime

The longest prefix of view retains no independent state. An Effect read samples the source once;
Fx observation follows later pushes and its observing Scope owns subscription cleanup.
