Extended state options for repositories that are context-aware.

Some repositories (like CurrentLimetype and CurrentLimeobject) can automatically react to context changes. When the context observable emits a new value, these repositories will re-evaluate and emit their state for the new context.

Hierarchy

Properties

Properties

context?: Subscribable<LimeWebComponentContext>

Observable that emits new context values to trigger state re-evaluation.

When provided, the repository will subscribe to this observable and re-fetch or re-evaluate its state whenever a new context is emitted. This is particularly useful for components that need to react to navigation or context switches.

Only applies to context-aware state services like:

  • CurrentLimetype - Updates when limetype in context changes
  • CurrentLimeobject - Re-fetches object when context ID changes
filter?: ((state: any) => boolean)[]

List of predicate functions that must all return true for updates to be emitted.

Filters are evaluated after map transformations. If any filter returns false, the callback is not invoked for that state change. Useful for preventing unnecessary updates. Functions are bound to the web component instance.

Example

filter: [
(state) => state !== null, // Ignore null states
(state) => state.isReady, // Only when ready
(state) => state.items.length > 0 // Only when has items
]
map?: ((state: any) => any)[]

List of transformation functions applied sequentially to the state.

Each function receives the output of the previous function (or the raw state for the first function). Use this to extract, transform, or compute derived values from the state. Functions are bound to the web component instance.

Example

map: [
(state) => state.orders, // Extract orders
(orders) => orders.filter(o => o.pending), // Filter to pending only
(pending) => pending.length // Get count
]
// Callback receives: number (count of pending orders)