Skip to content

Commit

Permalink
fix spelling errors and remove class name
Browse files Browse the repository at this point in the history
  • Loading branch information
jmesrje committed Jul 25, 2024
1 parent b344373 commit fddb240
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 36 deletions.
4 changes: 0 additions & 4 deletions aftman.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# This file lists tools managed by Aftman, a cross-platform toolchain manager.
# For more information, see https://github.com/LPGhatguy/aftman

# To add a new tool, add an entry to this table.
[tools]
argon = "argon-rbx/[email protected]"
wally = "UpliftGames/[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Creates a new compute object.
#### Parameters

- **processor:** `(get: (Constructor | any) -> ()) -> ()`\
The main function which will be run everytime the value changes
The main function which will be run every time the value changes

- **dependencies:** `{ State | Spring | Constructor }?`\
A table of dependencies whose values will be listened to
Expand Down
10 changes: 5 additions & 5 deletions docs/guide/new-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ While working with user interface, you may start to realize that creating the sa
::: code-group
```lua:line-numbers [Component]
local Aegis = require(path.to.Aegis)
local new = Aegis.new
local New = Aegis.new
type BackgroundProps = {
Color: Color3,
Expand All @@ -16,7 +16,7 @@ type BackgroundProps = {
}
return function(props: BackgroundProps)
return new("Frame", {
return New("Frame", {
BackgroundColor3 = props.Color,
AnchorPoint = Vector2.new(0.5, 0.5),
BroderSizePixel = 0,
Expand All @@ -28,7 +28,7 @@ end

```lua:line-numbers [Script]
local Aegis = require(path.to.Aegis)
local new = Aegis.new
local New = Aegis.new
local BackgroundComponent = require(path.to.BackgroundComponent)
Expand All @@ -49,7 +49,7 @@ local Main = new("ScreenGui", {
:::

:::warning
Do not include a key named `Children` inside of your props table, it will be overwritten!
Do not include a key named `Children` inside your props table, it will be overwritten!
:::

The way you create components in Aegis is very similar to how you do it in React as well, but better performance and less confusion.
Creating components in Aegis is very similar to how you would in React; we have found that this is the most user-friendly way to do so.
4 changes: 2 additions & 2 deletions src/Constructors/new.luau
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ local Types = require(Root.Types)
@return Instance
]]
return function <T>(
classOrComponent: Types.ClassName | Types.Component<T>,
classOrComponent: string | Types.Component<T>,
properties: (T & Types.Properties)?,
children: Types.Children?
): Instance
local Component
if type(classOrComponent) == "string" then
local Success, Result = pcall(Instance.new, classOrComponent) -- Create the instance wrapped inside pcall

if Success == true then
if Success then
if properties then
for property, value in properties :: any do
if property == "Parent" then
Expand Down
24 changes: 0 additions & 24 deletions src/Types.luau
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,6 @@ export type Properties = { [string | Key]: any }
export type Children = { [string | number]: any }

export type DefaultKeys = "Ref" | "Events" | "Changes" | "Cleanup" | "Attributes" | "Tags"
export type ClassName =
"CanvasGroup"
| "Frame"
| "TextButton"
| "TextLabel"
| "ScrollingFrame"
| "TextBox"
| "VideoFrame"
| "ViewportFrame"
| "ImageButton"
| "ImageLabel"
| "BillboardGui"
| "ScreenGui"
| "SurfaceGui"
| "UICorner"
| "UIGradient"
| "UIPadding"
| "UIScale"
| "UIStroke"
| "UIGridLayout"
| "UIListLayout"
| "UIPageLayout"
| "UITableLayout"
| string

export type Key = {
KeyName: DefaultKeys | string,
Expand Down

0 comments on commit fddb240

Please sign in to comment.