Skip to main content

A Python package for reactivity like Vue.js.

Project description

pyreactivity

A Python package for reactivity like Vue.js.

Test cases for all currently supported features are in tests directory, written in pytest. To run tests, use pytest command.

Installation

pip install pyreactivity

Supported features

  • ref function
  • computed function
  • reactive function
  • effect function
  • watch function
  • watch_effect ( watchEffect ) function
  • is_ref ( isRef ) function
  • is_computed_ref ( isComputedRef ) function
  • unref function
  • is_reactive ( isReactive ) function
  • to_raw ( toRaw ) function
  • mark_raw ( markRaw ) function

Simple Demo

from reactivity import ref, computed

a = ref('')
b = computed(lambda: ''.join(reversed(a.value)))
a.value = 'hello'
print(b.value)  # olleh
a.value = 'world'
print(b.value)  # dlrow

Inspiration

This package is inspired by Vue.js.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyreactivity-0.0.1.tar.gz (15.6 kB view hashes)

Uploaded Source

Built Distribution

pyreactivity-0.0.1-py3-none-any.whl (19.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page