Metadata-Version: 2.1
Name: pyreactivity
Version: 0.0.1
Summary: A Python package for reactivity like Vue.js.
Home-page: https://github.com/frederick-wang/pyreactivity
Author: Zhaoji Wang
Author-email: hwoam@outlook.com
License: Apache License 2.0
Project-URL: Bug Tracker, https://github.com/frederick-wang/pyreactivity/issues
Keywords: reactivity,vue,vuejs
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# 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

```bash
pip install pyreactivity
```

## Supported features

- [x] `ref` function
- [x] `computed` function
- [x] `reactive` function
- [x] `effect` function
- [x] `watch` function
- [x] `watch_effect` ( `watchEffect` ) function
- [x] `is_ref` ( `isRef` ) function
- [x] `is_computed_ref` ( `isComputedRef` ) function
- [x] `unref` function
- [x] `is_reactive` ( `isReactive` ) function
- [x] `to_raw` ( `toRaw` ) function
- [x] `mark_raw` ( `markRaw` ) function

## Simple Demo

```python
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.
