ygleam/y_array

Types

pub type YArrayError {
  YArrayError
  LengthExceeded
}

Constructors

  • YArrayError
  • LengthExceeded

Functions

pub fn clone(y_array: YArray) -> YArray
pub fn delete(
  y_array: YArray,
  index: Int,
  length: Int,
) -> Result(YArray, YArrayError)
pub fn delete_where(
  y_array: YArray,
  predicate: fn(YValue) -> Bool,
) -> YArray
pub fn doc(y_array: YArray) -> Option(YDoc)
pub fn for_each(
  y_array: YArray,
  cb: fn(YValue, Int, YArray) -> Nil,
) -> YArray
pub fn from(items: List(YValue)) -> YArray
pub fn get(y_array: YArray, index: Int) -> YValue
pub fn index_of(
  y_array: YArray,
  predicate: fn(YValue) -> Bool,
) -> Result(Int, Nil)
pub fn index_of_loop(
  y_array: YArray,
  predicate: fn(YValue) -> Bool,
  index: Int,
) -> Result(Int, Nil)
pub fn insert(
  y_array: YArray,
  index: Int,
  items: List(YValue),
) -> Result(YArray, YArrayError)
pub fn length(y_array: YArray) -> Int
pub fn map(
  y_array: YArray,
  cb: fn(YValue, Int, YArray) -> a,
) -> List(a)
pub fn new() -> YArray
pub fn observe(
  y_array: YArray,
  cb: fn(YArrayEvent, Transaction) -> Nil,
) -> fn() -> Nil
pub fn observe_deep(
  y_array: YArray,
  cb: fn(List(AnyYEvent), Transaction) -> Nil,
) -> fn() -> Nil
pub fn parent(y_array: YArray) -> Option(YType)
pub fn push(y_array: YArray, items: List(YValue)) -> YArray
pub fn slice(y_array: YArray, start: Int, end: Int) -> YArray
pub fn to_json(y_array: YArray) -> BaseType
pub fn to_list(y_array: YArray) -> List(YValue)
pub fn unshift(y_array: YArray, items: List(YValue)) -> YArray
Search Document