Metadata-Version: 2.2
Name: lilliepy-protect
Version: 1.0
Summary: A protection decorator to protect components
Home-page: https://github.com/websitedeb/lilliept-protect
Author: sarthak ghoshal
Author-email: sarthak22.ghoshal@gmail.com
Keywords: reactpy,lilliepy,lilliepy_protect
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: reactpy
Requires-Dist: reactpy_router
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# Lilliepy Protect

a decorator to protect you components

## how to use

```python
from lilliepy_protect import protect
from reactpy import component, html

@component
def fallback():
    return html.h1("u werent logged in...")

@protect(fallback=fallback, attr="logged_in")
@component
def ProtectedPage():
    return html.h1("welcome")
```

```python

# ...

protect -> (
    comp: reactpy.types.ComponentType, # the component to be protected
    fallback: reactpy.types.ComponentType, # the return url or component to navigate/render
    attr: str # the value to find in the scope (basically the granter code)(defaulted to "granted")
)

# ...

```
