signalLib is a small, simple library for intergrating reactivity concepts like signals and observables.
pip install signallib
from signallib import signal
name = signal('oarabile')
# this method takes in a function and
# when the value is changed, it passes
# the new variable into that function.
name.subscribe(lambda x: print(x))
# this is both our setter and getter
name.value = 'averylongnamecausewhynot'
# the "name" is printed onto the console
from signallib import observe
user = { "name": "oarabile", "age": 19 }
user = observe(user)
user.observer(lambda prop, value: print('The Prop Is ${prop}, and Value Of ${value}'))
user.name = 'john'
# we can even add custom properties
user.location = 'botswana'
# this is printed to the console 👇
# The Prop Is name, and Value Of john
We welcome contributions to rosana.ds! To contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make changes and commit (
git commit -am 'Add new feature'
). - Push to your fork (
git push origin feature-branch
). - Open a Pull Request.
Feel free to suggest new features and improvements.
This project is licensed under the MIT License. See the LICENSE file for details.