You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's important to note that all functional facts are memoized during each run of the rule engine, based on **shallow equality** of their argument. Currently, functions that accept an argument that contains values that are objects or arrays are not memoized. This will be fixed in an upcoming release.
173
+
172
174
Static facts are simply the values of the context object
173
175
174
176
### Actions
@@ -227,7 +229,7 @@ engine.run({ age: 32, name: 'Joe' }); // fires the log action with { message: 'H
227
229
228
230
#### Nesting Rules
229
231
230
-
The `then` or `otherwise` property can consist of either `actions`, but it can also contain another `when` clause. All functional facts in all [FactMaps](#factmaps) are evaluated simultaneously. By nesting `when`'s, you can cause facts to be executed serially.
232
+
The `then` or `otherwise` property can consist of either `actions`, but it can also contain a nested rule. All functional facts in all [FactMaps](#factmaps) are evaluated simultaneously. By nesting `when`'s, you can cause facts to be executed serially.
231
233
232
234
```js
233
235
constmyRule= {
@@ -300,7 +302,7 @@ const myRule = {
300
302
301
303
#### FactMap
302
304
303
-
A fact map is a plain object whose keys are facts (static or functional) and values are [`Evaluator`'s](#evaluator).
305
+
A FactMap is a plain object whose keys are facts (static or functional) and values are [`Evaluator`'s](#evaluator).
304
306
305
307
**NOTE: `factMapId` is a reserved word in a `FactMap`. It is used internally to allow easy access to the results of a `FactMap` for interpolation in the `then` or `otherwise` clauses. For this reason `factMapId`_CANNOT_ be given as a fact or context**.
306
308
@@ -384,10 +386,38 @@ The errors that can be emitted are:
384
386
-`FactEvaluationError` - errors thrown during the evaluation of facts/results from facts
385
387
-`ActionExecutionError` - errors thrown during the execution of actions
Help wanted! I'd like to really create great advanced types around the content of the facts, actions, and context given to the engine. Reach out [@akmjenkins](https://twitter.com/akmjenkins) or [[email protected]](mailto:[email protected])
423
+
Help wanted! I'd like to create really great advanced types around the content of the facts, actions, and context given to the engine. Reach out [@akmjenkins](https://twitter.com/akmjenkins) or [[email protected]](mailto:[email protected])
0 commit comments