-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improved global state system (#223)
* feat: made global state accessible through function This removes the function parameter method of accessing it. * refactor: made global state functions private on `RenderCtx` The macros don't handle global state now, and the user should just need `.get_global_state()`/`.try_get_global_state()`. * refactor: removed global state glob imports These used to be necessary to ensure that the macros could access the intermediate types, but the new functional access system prevents this! * chore: removed old commented code from tempalte macro * feat: removed need for importing intermediate reactive types These are now accessed purely through trait linkage, meaning no more weird glob imports for apps that stored their reactive state in different modules (or apps that were accessing state from another page outside that page). * fix: fixed `BorrowMut` errors on global state thawing * refactor: privatized global state on `RenderCtx` This prevents `BorrowMut` panics that are fairly likely if users access the global state manually. If this affects anyone's apps, please let me know! * chore: removed `get_render_ctx!()` macro This is pointless with `RenderCtx::from_ctx`. Also added `RenderCtx` to `perseus::prelude` for convenience. * chore: cleaned up a few things BREAKING CHANGES: removed `get_render_ctx!(cx)` in favor of `RenderCtx::from_ctx(cx)`; privatized global state on `RenderCtx`; made global state accessible through `render_ctx.get_global_state::<T>(cx)`, rather than through template function parameter
- Loading branch information
1 parent
825e990
commit 85d7f4a
Showing
23 changed files
with
402 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.