Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/remult/remult
Browse files Browse the repository at this point in the history
  • Loading branch information
noam-honig committed Apr 25, 2024
2 parents c6f1612 + 2092379 commit ee18070
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion docs/docs/working-without-decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
If you prefer to work without decorators, or use `remult` in a javascript project (without typescript) you can use the following:

## Entity
```ts{8-16}
::: code-group

```ts [Typescript]
import { Entity, Fields, describeClass } from "remult";

export class Task {
Expand All @@ -20,6 +22,28 @@ describeClass(Task,
completed: Fields.boolean()
})
```

```js [Javascript]
import { Entity, Fields, describeClass } from "remult";

export class Task {
id;
title = '';
completed = false;
}
describeClass(Task,
Entity("tasks", {
allowApiCrud: true
}),
{
id: Fields.uuid(),
title: Fields.string(),
completed: Fields.boolean()
})
```

:::

This is the same entity that is detailed in the [Entities section of the tutorial](https://remult.dev/tutorials/react/entities.html)

## Static BackendMethod
Expand Down

0 comments on commit ee18070

Please sign in to comment.