shardByTenant()
Build a passive { shardBy, shardCount } pair for tenant-isolated sharding.
Import
Section titled “Import”import { shardByTenant } from "@graphrefly/ts/patterns";Signature
Section titled “Signature”function shardByTenant( tenantOf: (fragment: MemoryFragment<T>) => string, opts: ShardByTenantOptions = {},): ShardByTenantConfig<T>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
tenantOf | (fragment: MemoryFragment<T>) => string | tenant of value used by the helper. |
opts | ShardByTenantOptions | Options that configure the helper. |
Returns
Section titled “Returns”A ShardByTenantConfig<T> value.
Example
Section titled “Example”import { shardByTenant } from "@graphrefly/ts/patterns";Source
Section titled “Source”packages/ts/src/patterns/semantic-memory.ts