Skip to main content

Reactives

A small, simple, and fast framework for reactive programming

Before anything else make sure you read and agree with the license.

Installation

Available through pip:

pip install jfaleiro.reactives

or poetry:

poetry add jfaleiro.reactives

Use

Reactives allow for three types of bindings: pre, post, and notify.

  • pre bindings - a chain of calls executed synchronously and in sequence before an update on state is performed. For R reactives, the value of the last execution on pre-binding chain is kept. Special shortcuts:

    • guard - used to establish boolean conditions for a change in state to fail.
  • post bindings - a chain of calls executed synchronously and in sequence after an update on state is performed. For synchronous notification purposes. Exceptions and updates are ignored.

  • notify bindings - a chain of calls executed asynchronously and after the last post call is performed. For asynchronous notification purposes. Exceptions and updates are ignored

with Context() as x:
    a = x.new(R, 1)
    b = x.new(R, 2)
    c = a + b

    assert a.value == 1
    assert b.value == 2
    assert c.value == 3

    a.pre(guard(lambda x: x > 0))
    c.pre(guard(lambda x: x >= 3))

    a.value = 4

    assert a.value == 4
    assert b.value == 2
    assert c.value == 6

To Know More

Look for plenty of examples of use under ./tests as well as Jupyter notebooks on ./samples for interactive use.

Enjoy.

Metadata

Release files for jfaleiro.reactives 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for jfaleiro.reactives 1.0.1
File Interpreter ABI Platform Actions
jfaleiro.reactives-1.0.1-py3-none-any.whl Python 3 none any Details for jfaleiro.reactives-1.0.1-py3-none-any.whl

Release files / jfaleiro.reactives-1.0.1-py3-none-any.whl

Download URL jfaleiro.reactives-1.0.1-py3-none-any.whl
Size 23.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c0450639b33cf3539e47f7e6087e62c0daec2cb0b9b261f123cb805b5c4e8e9
BLAKE2b-256 checksum
How to use checksums
85b6e676ebe0961a26477c241d4aa7b542ef38cc20b31153f46063374c463145
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.8 CPython/3.8.11 Linux/5.4.109+

Security for jfaleiro.reactives 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page