Skip to main content

A responsive system implemented in python with reference to the core mechanisms of S.js and vue reactivity.

Project description

py-signe

中文文档

Introduction

A responsive system implemented in python with reference to the core mechanisms of S.js and vue reactivity.

Installation

pip install signe

使用

from signe import signal, effect, computed

num = signal(1)

@computed
def plus1():
    return num.value + 1


@effect
def _():
    print('plus1 is :',plus1.value)

# should print `plus1 is :2`

num.value=10

# should print `plus1 is :11`
  • signal Creates a signal. Reads and writes via .value.
  • computed Creates a computed expression. The argument is a function. When a signal (signal.value) is used in the function to get a value, this calculation expression is automatically associated with the signal. When the value of the signal changes, the computed expression is automatically triggered to change.
  • effect is essentially the same as computed. A change in the signal or computed expression is automatically captured and triggered.

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

signe-0.4.21.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

signe-0.4.21-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file signe-0.4.21.tar.gz.

File metadata

  • Download URL: signe-0.4.21.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.2 Windows/10

File hashes

Hashes for signe-0.4.21.tar.gz
Algorithm Hash digest
SHA256 a7ce1ea544de1c11578079f00060af096c478450d082055b3ea297f460a87d5d
MD5 edd8035dd2a25bcbd4cc1242da72cbe0
BLAKE2b-256 65adb276a701c8ad299a56ad8d5bdee5d940bcdf82309832e6960266710845c5

See more details on using hashes here.

File details

Details for the file signe-0.4.21-py3-none-any.whl.

File metadata

  • Download URL: signe-0.4.21-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.2 Windows/10

File hashes

Hashes for signe-0.4.21-py3-none-any.whl
Algorithm Hash digest
SHA256 82e48dd1a061ddb279a3539d4f0e8c33821803d52b7d996fbb1b5fba31d0377b
MD5 428340f25ba55487da8373cafd20f0b3
BLAKE2b-256 adbc66bc5706954de140707a1cb5713616521c43793050d81ff99e9eeb2297fb

See more details on using hashes here.

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