Reaxive.Elm

This module contains reactive implementations that follow the interface design of the ELM language.

Currently, it does not work properly as the termination of computations is not handled correctly.

Summary

as_stream(signal, timeout \\ :infinity)

Converts a signal in to regular lazy Elixir stream

as_text(s)

Renders a signal as text

every(millis)

Function every is an input signal, i.e. it generates new signal values in an asynchronous manner. As an input signal is does not rely an any other signals, it is a root in dependency graph of signals

filter(signal, pred)
from_stream(s)
lift(signal, fun)

Function lift creates a new signal of type b by applying function fun to each value of signal, which has type a. Consequently, function fun maps from type a to b

log(msg)
make_signal(value \\ nil)

Creates a new signal instance with optional value

push(fun)

Functional pushing of signals without any state interaction

signal_handler(subscriptions \\ [], fun, signal, state \\ nil)

Implements the internal receive loop for a signal

stop(signal)
stream_handler(signal)
test()
test2()
test3()
with_index(signal)

Creates a Signal where each item from the signal will be wrapped in a tuple alongside its index

Types

signal :: Signal.t(any)

signal(a) :: Signal.t(a)

sig_func :: (any, any -> {:reply, any, any} | {:noreply, any})

Functions

as_stream(signal, timeout \\ :infinity)

Specs:

Converts a signal in to regular lazy Elixir stream.

as_text(s)

Specs:

  • as_text(signal | pid) :: :none

Renders a signal as text.

every(millis)

Specs:

Function every is an input signal, i.e. it generates new signal values in an asynchronous manner. As an input signal is does not rely an any other signals, it is a root in dependency graph of signals.

filter(signal, pred)

Specs:

from_stream(s)
lift(signal, fun)

Specs:

Function lift creates a new signal of type b by applying function fun to each value of signal, which has type a. Consequently, function fun maps from type a to b.

log(msg)
make_signal(value \\ nil)

Specs:

Creates a new signal instance with optional value.

push(fun)

Functional pushing of signals without any state interaction.

signal_handler(subscriptions \\ [], fun, signal, state \\ nil)

Specs:

Implements the internal receive loop for a signal.

Its task is to manage the subscriptions of signals to which values are propagated. Subscriptions are managed with register, unregister and DOWN messages. The latter are created by monitoring signals and ensures that died signals are automatically unsubscribed, helping in both situations when nasty things happen and when signals do not know how to unsubscribe.

stop(signal)
stream_handler(signal)
test()
test2()
test3()
with_index(signal)

Creates a Signal where each item from the signal will be wrapped in a tuple alongside its index.

Does not work yet!