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

Fix typo and Cleanup #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions docs/additional-modules/components/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ You can add a `predicate` function to a component to determine if the component
This only affects Components created via **CollectionService**!
```ts
@Component({
tag: "Example",
predicate: ( instance ) => instance.FindFirstAncestorOfClass("PlayerGui") !== undefined,
tag: "Example",
predicate: (instance) => instance.FindFirstAncestorOfClass("PlayerGui") !== undefined,
})
export class ExampleComponent extends BaseComponent implements OnStart {}
```
Expand Down Expand Up @@ -57,10 +57,10 @@ The `instanceGuard` is similar to `predicate`, but serves a slightly different p

Note: Using `instanceGuard` will override the automatically generated type guard, which is created when providing the `BaseComponent` with an Instance type!
```ts
@Component( {
tag: "Example",
instanceGuard: Flamework.createGuard<any>()
} )
@Component({
tag: "Example",
instanceGuard: Flamework.createGuard<any>()
})
export class ExampleComponent extends BaseComponent<{}, Model> implements OnStart {}
```

Expand All @@ -70,15 +70,15 @@ You can use `defaults` to specify the value of the Component's attributes if the
Normally, you must assign all the attributes to a Component otherwise it will not be created. If you specify the `defaults` though, the Component can be created without specifying those attributes.
```ts
interface Attributes {
amount: number
amount: number
}

@Component( {
tag: "Example",
defaults: {
"amount": 1
}
} )
@Component({
tag: "Example",
defaults: {
"amount": 1
}
})
export class ExampleComponent extends BaseComponent<Attributes, Part> implements OnStart {}
```

Expand All @@ -88,15 +88,15 @@ You can use `attributes` to specify custom type guards for attributes defined in
The example uses the [t package](https://www.npmjs.com/package/@rbxts/t) to specify the value of the `amount` attribute, which should only ever be a number between 1 and 5.
```ts
interface Attributes {
amount: number
amount: number
}

@Component( {
tag: "Example",
attributes: {
amount: t.numberConstrained( 1, 5 )
}
} )
@Component({
tag: "Example",
attributes: {
amount: t.numberConstrained(1, 5)
}
})
export class ExampleComponent extends BaseComponent<Attributes> implements OnStart {}
```

Expand All @@ -110,13 +110,13 @@ If set to `false`, the Components attributes (`this.attributes.example`) will no
Note: Setting `refreshAttributes` to false will disable the `onAttributeChanged` handlers!
```ts
interface Attributes {
amount: number
amount: number
}

@Component( {
tag: "Example",
refreshAttributes: false
} )
@Component({
tag: "Example",
refreshAttributes: false
})
export class ExampleComponent extends BaseComponent<Attributes, Part> implements OnStart {}
```

Expand All @@ -132,9 +132,9 @@ Ancestor configuration only affects `CollectionService` components and will not

```ts
@Component({
tag: "ExampleComponent",
ancestorBlacklist: [Lighting],
ancestorWhitelist: [Workspace],
tag: "ExampleComponent",
ancestorBlacklist: [Lighting],
ancestorWhitelist: [Workspace],
})
export class ExampleComponent extends BaseComponent {}
```
Expand All @@ -146,13 +146,13 @@ Generally, you will only encounter this warning when something has gone wrong (y

```ts
@Component({
tag: "ExampleComponent",
tag: "ExampleComponent",

// Disable the warning entirely.
warningTimeout: 0,
// Disable the warning entirely.
warningTimeout: 0,

// Warn only after 60 seconds have passed.
warningTimeout: 60,
// Warn only after 60 seconds have passed.
warningTimeout: 60,
})
export class ExampleComponent extends BaseComponent {}
```
2 changes: 1 addition & 1 deletion docs/additional-modules/networking/remote-functions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Remote Functions
---
RemoteFunctions are for two way communicates between the server and client. This means the sender is able to receive a response from the receiver. Flamework's RemoteFunctions implementation use promises which allow you to avoid any dangerous yields, errors, etc. All requests have a timeout of 10 seconds.
RemoteFunctions are for two way communicates between the server and client. This means the sender is able to receive a response from the receiver. Flamework's RemoteFunctions implementation use promises which allow you to avoid any dangerous yields, errors, etc. All requests have a timeout of 10 seconds.

Whilst it is not recommended, Flamework does support `ServerToClient` remote functions. Flamework avoids common pitfalls by implementing timeouts and cancellation (such as a player leaving) using promises.

Expand Down
2 changes: 1 addition & 1 deletion docs/frequently-asked.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is a compilation of frequently asked questions. If you have any question no
You should prefer using `OnStart`, unless you need the unique behavior of `OnInit`.

### Should I commit `flamework.build` into Git?
No, this file is meant for storing information that Flamework needs inbetween compiles and is generally discarded if it can be.
No, this file is meant for storing information that Flamework needs between compiles and is generally discarded if it can be.

### Should I include `flamework.build` in my package?
Yes, you should include the file whenever you publish your package.
Expand Down
8 changes: 4 additions & 4 deletions docs/guides/creating-a-singleton.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ You can use the `loadOrder` configuration to override the order that singletons
The default `loadOrder` property defaults to `1` and decreasing the `loadOrder` causes the singleton to load earlier.

```ts
@Controller( {
loadOrder: 0 // Loads BEFORE all other controllers with default loadOrder
@Controller({
loadOrder: 0 // Loads BEFORE all other controllers with default loadOrder
})
```

```ts
@Controller( {
loadOrder: 2 // Loads AFTER all other controllers with default loadOrder
@Controller({
loadOrder: 2 // Loads AFTER all other controllers with default loadOrder
})
```
2 changes: 1 addition & 1 deletion docs/guides/utility-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function Flamework.createGuard<T>(): t.check<T>;
### Description
Creates a guard for the type parameter `T`.

Guards are generated in a way that mimicks how the type can be used in TypeScript which means generics will resolve to their constraints, (unsimplified) conditionals will resolve to a union between both true/false types, etc.
Guards are generated in a way that mimics how the type can be used in TypeScript which means generics will resolve to their constraints, (unsimplified) conditionals will resolve to a union between both true/false types, etc.

### Returns
The generated guard for type parameter `T`.
Expand Down