Skip to content

Commit

Permalink
docs: improved readme with examples
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxblank committed Nov 7, 2020
1 parent cf5d253 commit 1631a97
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ with npm:
npm i rulerx
```

### Writing basic rule
### Writing basic rules

First, let's define one model of our context.
First, let's define one model of our context

```ts
class Person {name: string; surname: string }
interface Person {name: string; surname: string }
```

Then lets defines our rule sets:
Then we define our rule sets

```ts
const rules: RuleSet<Person>[] = [
Expand Down Expand Up @@ -95,7 +95,7 @@ new RuleRx<Person>()
})
```

This will emit :
Since only *Jhon Doe* match **all** the rules (equal $.name && equal $.surname) this will emit:
```
{
name : "Jhon",
Expand Down

0 comments on commit 1631a97

Please sign in to comment.