Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference between Context and Facts #23

Open
fhirter opened this issue Aug 21, 2024 · 0 comments
Open

Difference between Context and Facts #23

fhirter opened this issue Aug 21, 2024 · 0 comments

Comments

@fhirter
Copy link

fhirter commented Aug 21, 2024

From the README it do not fully understand the difference between "facts" and "context".

In the basic example "facts" seems to be the data on which the business rules are applied. The "context" can be used to parametrize rules.
Is this correct?

Why does it state below context that "It [context] can be used for interpolation or even as a source of facts".
In this chapter it seems that context is being evaluated agains the rules. But the context object

const context = {
  hotTemp: 20,
  city: 'Halifax',
  apiKey: 'XXXX',
  units: 'metric',
};

does not seem to match the rules:

    path: 'main.temp',
    is: {
      type: 'number',
      minimum: '{{hotTemp}}',
    },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant