diff --git a/docs/additional-modules/components/configuration.md b/docs/additional-modules/components/configuration.md index ac7b680..315d3be 100644 --- a/docs/additional-modules/components/configuration.md +++ b/docs/additional-modules/components/configuration.md @@ -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 {} ``` @@ -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() -} ) +@Component({ + tag: "Example", + instanceGuard: Flamework.createGuard() +}) export class ExampleComponent extends BaseComponent<{}, Model> implements OnStart {} ``` @@ -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 implements OnStart {} ``` @@ -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 implements OnStart {} ``` @@ -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 implements OnStart {} ``` @@ -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 {} ``` @@ -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 {} ``` diff --git a/docs/additional-modules/networking/remote-functions.md b/docs/additional-modules/networking/remote-functions.md index 1a793fb..2b29e3b 100644 --- a/docs/additional-modules/networking/remote-functions.md +++ b/docs/additional-modules/networking/remote-functions.md @@ -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. diff --git a/docs/frequently-asked.mdx b/docs/frequently-asked.mdx index 4544473..bcad289 100644 --- a/docs/frequently-asked.mdx +++ b/docs/frequently-asked.mdx @@ -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. diff --git a/docs/guides/creating-a-singleton.md b/docs/guides/creating-a-singleton.md index 521743b..6799d7c 100644 --- a/docs/guides/creating-a-singleton.md +++ b/docs/guides/creating-a-singleton.md @@ -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 }) ``` diff --git a/docs/guides/utility-macros.md b/docs/guides/utility-macros.md index a2a4471..007cc3d 100644 --- a/docs/guides/utility-macros.md +++ b/docs/guides/utility-macros.md @@ -57,7 +57,7 @@ function Flamework.createGuard(): t.check; ### 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`.