Header menu logo Sutil

Core Module

The Sutil core engine. Definition for type SutilElement and functions that instantiate Browser DOM from SutilElement.

Types and nested modules

Type/Module Description

ContextHelpers

PipelineFn

SutilEffect

A SutilEffect is the result of evaluating a SutilElement, and can be one of the following:

SideEffect
This usually means the SutilElement was an attribute, and its evaluation resulted in a DOM call such as setAttribute, or classlist.add, etc
DomNode of Node
The SutilElement created a DOM Node. This is usually a Text or an HTMLElement
Group of SutilGroup
A SutilGroup has been created

SutilElement

Sutil's element type. This is an abstraction of DOM elements, attributes, events, etc. The type itself is a function that maps BuildContext to a SutilEffect, wrapped in a private record to isolate users from implementation details as much as possible:

 type SutilElement = private { Builder: BuildContext -> SutilEffect }
type SutilElement = private { Builder: (obj -> obj) }
Examples of SutilElements:
  • Html.div
  • Attr.className
  • Ev.onClick
  • Core.disposeOnUnmount
  • Core.host

SutilGroup

Functions and values

Function or value Description

build f ctx

Full Usage: build f ctx

Parameters:
Returns: SutilEffect

Instantiate a SutilElement.

f : SutilElement
ctx : BuildContext
Returns: SutilEffect

Type something to start searching.