Description
rsx('a + b')returns a function that binds the expression to your model. Only the model parts used by the expression become reactive. For example, with rsx('a + b'), fields a and b are tracked, while an unrelated field like c is not.
API Reference
rsx takes an expression string and returns a binder function. Call the binder with a model to get an executable expression instance.
rsx('a + b')returns a function that binds the expression to your model. Only the model parts used by the expression become reactive. For example, with rsx('a + b'), fields a and b are tracked, while an unrelated field like c is not.
Expression string to parse (for example 'a + b').
Target object context bound to the expression.
Optional rule controlling how leaf index dependencies are watched.
Returns a binder function: (model, leafIndexWatchRule?) => IExpression<TReturn>
Load RsXExpressionParserModule into the InjectionContainer before using rsx.
You can also resolve the singleton IExpressionFactory from the InjectionContainer and call create(...) directly. That works, but rsx(...) is the simplest entry point and avoids extra DI boilerplate in application code.