Skip to content

getSelectedState :function

function getSelectedState(props: GetSelectedStateProperties): (use: Use, innerScope: Scope) -> any
This utility function is used to select an option from an options list. It returns a callback function generally meant to be used within Computeds. This function also keeps track of the given values, and if they change, re-calculates the result.

Default Syntax

local getSelectedState = require(StudioComponents.Util.getSelectedState)
local returnedFunction = Scope:Computed(getSelectedState(props))

Parameters

props: GetSelectedStateProperties The table which contains the properties that will be used within the returned callback function.

Returns Function

Parameters

use: Use The use function that will be given automatically.
innerScope: Scope The inner scope that will be given automatically.

Returns

any