📄
BoltUI Docs (Preview)
  • Getting Started
    • Introduction
    • Installing Bolt
    • Hello World
  • Understanding Bolt
    • Creating UI
    • Components
    • Properties & Events
    • Styles
    • Custom Components
    • Reactivity
    • Component Lifecycle
    • Routing
  • API Reference
    • index
      • State
      • Component
      • render
      • attribute
      • event
      • onLoad
      • onRemove
      • id
      • Class
      • When
    • components
      • Link
      • AppLink
      • GenericElement
    • events
      • onGenericEvent
    • boltrouter
      • Router
      • AppRouter
      • Url
      • Navigate
      • AppNavigator
  • Future
    • Server Side Rendering
    • Multi-Platform
Powered by GitBook
On this page
  • Definition
  • Input
  • Returns an object
  1. API Reference
  2. index

State

Definition

function State(initial: any) {
    return {
        update: function,
        get: function,
        onUpdate: function
    }
}

Input

Takes initial of any type

Returns an object

  • update(value: any) : updates the current state with the input value

  • get() : returns the current state

  • onUpdate(value: function) : takes a callback function and calls the function whenever the state is updated

PreviousindexNextComponent

Last updated 2 years ago