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)
Built Distribution
Close
Hashes for pyreactivity-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4405489204f98d20814d530a04d8677e70cac35e488e7b543ebd46a3653437a |
|
MD5 | a269dc5fec6108689402dc71ee9e2918 |
|
BLAKE2b-256 | 8d7b06df0fa946a4cab56c29fd604f245433b8f4374fc383f40d888cfeca4650 |