Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions remotestate-py/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## Version 0.3.3 (in development)
## Version 0.3.3

- Improved usability of the Python `Store` class:
- Introduced public protocol `StoreAt` now returned
from `Store.at` instead of internal `_StoreAt` type.
- Added `StoreAt.value` read-only property to access the value
of a node returned by `Store.at`.
- Introduced public protocol `StoreAt` now returned from `Store.at` instead
of internal `_StoreAt` type.
- Added `StoreAt.value` read-only property to access the value of a node
returned by `Store.at`.

- The Python `ServeResult` class now renders as a HTML table in notebooks.
- The Python `ServeResult` class now renders as an HTML table in notebooks.


## Version 0.3.2
Expand Down
2 changes: 1 addition & 1 deletion remotestate-py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "remotestate"
version = "0.3.3.dev0"
version = "0.3.3"
authors = [{name = "forman"}]
description = "Python state, React UI."
readme = "README.md"
Expand Down
10 changes: 5 additions & 5 deletions remotestate-py/src/remotestate/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ def __init__(
value is supported, including mappings, lists, and scalars.
default_factory: Optional callable used by ``set()`` to
create missing intermediate path values. It receives the
missing prefix path as a ``Path`` tuple, such as one
containing ``"user"`` or ``0`` segments.
If omitted, missing parents raise the same ``KeyError``,
``IndexError``, or ``AttributeError`` as before.
missing prefix path as a ``Path`` tuple, such as ``("users", 3)``.
If omitted, a missing parent will raise either a ``KeyError``,
``IndexError``, or ``AttributeError``.
"""
self._state = initial
self._default_factory = default_factory
Expand Down Expand Up @@ -195,8 +194,8 @@ def __repr__(self) -> str: ...
class _StoreAt(StoreAt):
"""Path-building proxy implementation returned by ``Store.at``."""

_path: Path
_store: Store[Any]
_path: Path

# Only these names are real attributes; all other attributes are path segments.
# It prevents silently and accidentally created attributes.
Expand All @@ -208,6 +207,7 @@ def __init__(self, store: Store[Any], path: Path = ()) -> None:

@property
def value(self) -> Any:
"""The store's value at the current path location."""
return self._store.get(self._path)

def __getattr__(self, name: str) -> _StoreAt:
Expand Down
2 changes: 1 addition & 1 deletion remotestate-ts/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Version 0.3.3 (in development)
## Version 0.3.3

- Improved usability of the Python `Store` class.

Expand Down
4 changes: 2 additions & 2 deletions remotestate-ts/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion remotestate-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remotestate",
"version": "0.3.2",
"version": "0.3.3",
"description": "Python state, React UI.",
"type": "module",
"main": "./dist/remotestate.js",
Expand Down