mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
43 lines
776 B
Lua
43 lines
776 B
Lua
local vide = require "src/init"
|
|
local source = vide.source
|
|
local derive = vide.derive
|
|
local map = vide.map
|
|
local create = vide.create
|
|
|
|
type Action<T> = {
|
|
type: T,
|
|
priority: number,
|
|
callback: (Instance) -> ()
|
|
}
|
|
|
|
local function processor(priority: number, fn: (Instance) -> ()): Action<any>
|
|
|
|
end
|
|
|
|
local function Changed(property: string, callback: () -> ())
|
|
return processor(1, function(instance)
|
|
instance:GetPropertyChangedSignal(property):Connect(callback)
|
|
end) :: Action<"Changed">
|
|
end
|
|
|
|
local function Cleanup(t: {})
|
|
|
|
end
|
|
|
|
function TextInput(p: {
|
|
OnInput: Action<"Changed">
|
|
})
|
|
create "TextBox" {
|
|
Text = "test",
|
|
|
|
Changed("Text", function()
|
|
|
|
end),
|
|
|
|
Cleanup {
|
|
|
|
},
|
|
|
|
create("Frame") {}
|
|
}
|
|
end
|