EYHN
20a0d0b1db
chore: bump blocksuite ( #6694 )
...
## Features
- https://github.com/toeverything/BlockSuite/pull/6863 @regischen
- https://github.com/toeverything/BlockSuite/pull/6852 @doouding
- https://github.com/toeverything/BlockSuite/pull/6860 @pengx17
- https://github.com/toeverything/BlockSuite/pull/6856 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6849 @fundon
## Bugfix
- https://github.com/toeverything/BlockSuite/pull/6873 @pengx17
- https://github.com/toeverything/BlockSuite/pull/6870 @golok727
- https://github.com/toeverything/BlockSuite/pull/6851 @golok727
- https://github.com/toeverything/BlockSuite/pull/6848 @pengx17
- https://github.com/toeverything/BlockSuite/pull/6847 @fundon
- https://github.com/toeverything/BlockSuite/pull/6867 @EYHN
- https://github.com/toeverything/BlockSuite/pull/6868 @fundon
- https://github.com/toeverything/BlockSuite/pull/6869 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6865 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6866 @fundon
- https://github.com/toeverything/BlockSuite/pull/6864 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6824 @undefined
- https://github.com/toeverything/BlockSuite/pull/6859 @fundon
- https://github.com/toeverything/BlockSuite/pull/6853 @fundon
- https://github.com/toeverything/BlockSuite/pull/6854 @fundon
- https://github.com/toeverything/BlockSuite/pull/6845 @fourdim
## Refactor
- https://github.com/toeverything/BlockSuite/pull/6872 @fundon
## Misc
2024-04-25 05:12:02 +00:00
EYHN
c0cd33b65a
fix(core): fix react error ( #6692 )
...

2024-04-25 04:39:25 +00:00
EYHN
e5baa81a50
chore: bump blocksuite ( #6673 )
2024-04-23 08:39:23 +00:00
EYHN
c425cfa598
chore: bump blocksuite ( #6666 )
...
## Features
- https://github.com/toeverything/BlockSuite/pull/6842 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6836 @regischen
## Bugfix
- https://github.com/toeverything/BlockSuite/pull/6837 @pengx17
- https://github.com/toeverything/BlockSuite/pull/6803 @lawvs
- https://github.com/toeverything/BlockSuite/pull/6843 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6838 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6834 @regischen
- https://github.com/toeverything/BlockSuite/pull/6835 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6831 @pengx17
- https://github.com/toeverything/BlockSuite/pull/6827 @golok727
- https://github.com/toeverything/BlockSuite/pull/6828 @regischen
## Refactor
## Misc
2024-04-23 01:38:23 +00:00
EYHN
d36b5e14aa
feat(core): try cloud link ( #6660 )
2024-04-22 08:51:02 +00:00
EYHN
b7ade43c2e
feat(core): adjust help island style ( #6651 )
2024-04-22 08:27:28 +00:00
EYHN
ab7282213b
feat(core): adjust workspace avatar style ( #6652 )
...

2024-04-22 08:16:41 +00:00
EYHN
9fd3f29d1b
fix(core): fix home page init cloud ( #6654 )
2024-04-22 08:05:20 +00:00
EYHN
5e243de392
feat(server): auto refresh session ( #6613 )
2024-04-19 07:00:12 +00:00
EYHN
a2fa9149ff
feat(templates): add stickers ( #6629 )
2024-04-19 06:47:29 +00:00
EYHN
4085cc6728
fix(core): fix subscribe link for pro plan ( #6627 )
2024-04-19 06:36:38 +00:00
EYHN
6a23fe37a7
feat(core): reduce profile loading time ( #6616 )
2024-04-18 15:23:12 +00:00
EYHN
08cd940e6b
fix(server): fix unstable test ( #6621 )
2024-04-18 14:53:24 +00:00
EYHN
a537f8eb0b
fix(electron): cookie expires too short ( #6615 )
2024-04-18 13:41:56 +00:00
EYHN
09832dc940
feat(core): add subscribe link ( #6610 )
2024-04-18 13:28:32 +00:00
EYHN
f86646b931
feat(core): enrich pwa manifest.json ( #6599 )
2024-04-17 19:14:25 +08:00
EYHN
4b933466f4
fix(storybook): remove storybook testing ( #6595 )
...
remove tests/storybook
@affine/components storybook still exists
2024-04-17 17:27:33 +08:00
EYHN
ed96c4ece4
fix(core): fix navigate not working ( #6594 )
...
navigate sometimes doesn't work
It seems that we shouldn't pass the parent component's navigate function to the child component, but adding an effect to delay the child component rendering seems to work.
2024-04-17 16:43:29 +08:00
EYHN
c83d090282
fix(core): revalidate subscription info when open ai usage panel ( #6591 )
2024-04-17 16:36:12 +08:00
EYHN
6ca174bb14
fix(core): revalidate subscription info when open ai usage panel
2024-04-17 15:54:01 +08:00
EYHN
c7373d4651
feat(infra): framework ( #6403 )
...
* Business are implemented in modules
* All modules are split into `services`, `entities`, `stores`, to achieve better abstraction
* most of asynchronous loading has been changed to `effect` implementation, with a good retry strategy
* critical network requests have been cached, app can be used offline normally.
* user session has been cached, and will be used offline.
* `workspace list provider` and `factory provider` are unified into `workspace flavor provider`
* `page` has been rename to `doc`, unified with `blocksuite`
2024-04-17 15:20:13 +08:00
EYHN
06fda3b62c
feat(infra): framework
2024-04-17 15:09:09 +08:00
EYHN
8bb597d7ad
fix(core): fix flaky e2e ( #6559 )
2024-04-15 07:11:36 +00:00
EYHN
d11d69ddf6
feat(core): move help island to workbench ( #6535 )
2024-04-15 02:29:15 +00:00
EYHN
1656b33ce3
feat(core): use zip snapshot for onboarding page ( #6495 )
2024-04-15 02:16:08 +00:00
EYHN
9e7a2fcf0e
feat(server): add pro quota to dev user ( #6532 )
2024-04-12 06:45:18 +00:00
EYHN
1e12d4a2cb
feat(core): remove ai from experimental features ( #6529 )
2024-04-12 06:45:10 +00:00
EYHN
c92bec0ebb
chore: bump blocksuite ( #6448 )
...
## Features
- https://github.com/toeverything/BlockSuite/pull/6679 @pengx17
- https://github.com/toeverything/BlockSuite/pull/6620 @doouding
- https://github.com/toeverything/BlockSuite/pull/6602 @golok727
- https://github.com/toeverything/BlockSuite/pull/6661 @Flrande
- https://github.com/toeverything/BlockSuite/pull/6591 @fundon
- https://github.com/toeverything/BlockSuite/pull/6634 @golok727
- https://github.com/toeverything/BlockSuite/pull/6626 @regischen
- https://github.com/toeverything/BlockSuite/pull/6630 @Saul-Mirone
- https://github.com/toeverything/BlockSuite/pull/6605 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6614 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6508 @doouding
- https://github.com/toeverything/BlockSuite/pull/6578 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6572 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6571 @golok727
- https://github.com/toeverything/BlockSuite/pull/6573 @fundon
- https://github.com/toeverything/BlockSuite/pull/6580 @Flrande
- https://github.com/toeverything/BlockSuite/pull/6540 @golok727
- https://github.com/toeverything/BlockSuite/pull/6567 @Flrande
- https://github.com/toeverything/BlockSuite/pull/6565 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6561 @zzj3720
## Bugfix
- https://github.com/toeverything/BlockSuite/pull/6677 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6681 @fundon
- https://github.com/toeverything/BlockSuite/pull/6673 @fundon
- https://github.com/toeverything/BlockSuite/pull/6652 @fundon
- https://github.com/toeverything/BlockSuite/pull/6641 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6649 @golok727
- https://github.com/toeverything/BlockSuite/pull/6648 @doouding
- https://github.com/toeverything/BlockSuite/pull/6662 @Flrande
- https://github.com/toeverything/BlockSuite/pull/6659 @zkwolf
- https://github.com/toeverything/BlockSuite/pull/6644 @doouding
- https://github.com/toeverything/BlockSuite/pull/6633 @golok727
- https://github.com/toeverything/BlockSuite/pull/6632 @golok727
- https://github.com/toeverything/BlockSuite/pull/6622 @RubaXa
- https://github.com/toeverything/BlockSuite/pull/6622 @RubaXa
- https://github.com/toeverything/BlockSuite/pull/6622 @RubaXa
- https://github.com/toeverything/BlockSuite/pull/6622 @RubaXa
- https://github.com/toeverything/BlockSuite/pull/6622 @RubaXa
- https://github.com/toeverything/BlockSuite/pull/6600 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6617 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6618 @Flrande
- https://github.com/toeverything/BlockSuite/pull/6576 @fundon
- https://github.com/toeverything/BlockSuite/pull/6595 @fundon
- https://github.com/toeverything/BlockSuite/pull/6596 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6574 @fundon
- https://github.com/toeverything/BlockSuite/pull/6593 @Saul-Mirone
- https://github.com/toeverything/BlockSuite/pull/6588 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6590 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6589 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6584 @lawvs
- https://github.com/toeverything/BlockSuite/pull/6579 @fundon
- https://github.com/toeverything/BlockSuite/pull/6538 @golok727
- https://github.com/toeverything/BlockSuite/pull/6570 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6569 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6564 @zzj3720
- https://github.com/toeverything/BlockSuite/pull/6563 @zzj3720
## Refactor
- https://github.com/toeverything/BlockSuite/pull/6683 @doodlewind
- https://github.com/toeverything/BlockSuite/pull/6668 @Flrande
- https://github.com/toeverything/BlockSuite/pull/6635 @donteatfriedrice
- https://github.com/toeverything/BlockSuite/pull/6653 @fundon
- https://github.com/toeverything/BlockSuite/pull/6615 @Flrande
- https://github.com/toeverything/BlockSuite/pull/6534 @Saul-Mirone
- https://github.com/toeverything/BlockSuite/pull/6553 @golok727
## Misc
- chore(examples): cleanup types
- https://github.com/toeverything/BlockSuite/pull/6664 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6657 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6654 @fourdim
- https://github.com/toeverything/BlockSuite/pull/6587 @Saul-Mirone
- https://github.com/toeverything/BlockSuite/pull/6562 @donteatfriedrice
2024-04-10 12:25:37 +00:00
EYHN
939fa9cef0
fix(component): sign up password max length notify ( #6467 )
...
The input `maxLength` causes password to be automatically truncated without notice user.
2024-04-10 06:20:21 +00:00
EYHN
97c4ae48b5
fix(infra): fix sync issues on old ids ( #6474 )
2024-04-09 04:40:15 +00:00
EYHN
366e0a4b60
feat(server): adjust telemetry config ( #6424 )
2024-04-02 03:44:48 +00:00
EYHN
8bd2408b0c
fix(core): selfhost should not use favicon from affine.pro ( #6425 )
2024-04-02 03:31:34 +00:00
EYHN
80c7750f4a
fix(core): selfhost redirect url ( #6426 )
2024-04-01 13:26:39 +00:00
EYHN
9c6eba8971
fix(electron): fix build script ( #6422 )
2024-04-01 07:51:35 +00:00
EYHN
1c648c2425
test(infra): add test for livedata with react ( #6397 )
2024-03-29 07:10:40 +00:00
EYHN
4e7652f108
fix(infra): fix white screen issue ( #6350 )
2024-03-28 02:12:25 +00:00
EYHN
ba9dad95b4
fix(core): improve performance ( #6345 )
2024-03-27 14:01:54 +00:00
EYHN
30b8b12703
fix(infra): fix sqlite not save data ( #6336 )
...
SQLiteDB will not save subdoc data that does not exist on rootdoc, so we must save rootdoc first, and then save subdoc
2024-03-27 04:25:23 +00:00
EYHN
cccf864ed9
fix(core): duplicate window controls in trash ( #6329 )
...
fix https://github.com/toeverything/AFFiNE/issues/6310
2024-03-27 02:37:53 +00:00
EYHN
16063340d0
fix(core): fix meta.xxx is undefined ( #6321 )
2024-03-26 08:53:14 +00:00
EYHN
b6bba523ff
fix(infra): large page list performance ( #6319 )
2024-03-26 07:53:53 +00:00
EYHN
3e547ce4cc
fix(core): hidden modals when workspace fallback ( #6301 )
2024-03-25 13:52:08 +00:00
EYHN
da12a0e48e
fix(core): fix error when switch to local workspace ( #6144 )
2024-03-25 21:35:10 +08:00
EYHN
a8cd1579f5
feat(infra): livedata effect ( #6281 )
2024-03-25 06:09:45 +00:00
EYHN
f2adbdaba4
style: enable import-x/no-duplicates ( #6279 )
2024-03-25 03:55:33 +00:00
EYHN
7ce2bfbf0b
style: no import infra submodule ( #6278 )
2024-03-25 03:55:29 +00:00
EYHN
b93871f045
feat(electron): define runtimeConfig in esbuild ( #6287 )
2024-03-25 03:55:26 +00:00
EYHN
d59e1389ec
chore(electron): config vitest swc ( #6282 )
2024-03-25 03:55:23 +00:00
EYHN
82cacd09d6
fix(core): fix flaky e2e ( #6293 )
2024-03-25 02:58:52 +00:00
EYHN
2b42a75e5a
style: enable rxjs/finnish ( #6276 )
...
chore(infra): use finnish notation for observables
do rename
2024-03-24 17:04:51 +00:00
EYHN
34703a3b7d
feat(infra): new doc sync engine ( #6205 )
...
https://github.com/toeverything/AFFiNE/blob/eyhn/feat/new-sync/packages/common/infra/src/workspace/engine/doc/README.md
2024-03-22 16:43:26 +00:00
EYHN
a0b97f948c
fix(core): fix stuttering when change doc title ( #6269 )
2024-03-22 10:06:37 +00:00
EYHN
39cde560d1
fix(templates): fix typo in onboarding template ( #6221 )
2024-03-20 16:19:28 +00:00
EYHN
5623c0967c
feat(electron): enable css text autospace ( #6218 )
...
before

after

2024-03-20 02:47:49 +00:00
EYHN
78f7e3a45e
fix(core): catch page load error ( #6134 )
2024-03-15 08:44:36 +00:00
EYHN
9ba47f43bb
fix(core): fix active view undefined ( #6131 )
...
close https://github.com/toeverything/AFFiNE/issues/6127 , #6132
2024-03-15 03:45:41 +00:00
EYHN
12c04a8575
feat(core): allow switch workspace in loading fallback ( #6129 )
2024-03-15 03:45:32 +00:00
EYHN
96c67afc11
fix(core): catch auth error ( #6128 )
2024-03-15 03:45:23 +00:00
EYHN
b9fc848824
fix(infra): avoid data loss ( #6111 )
2024-03-14 06:27:49 +00:00
EYHN
fd9084ea6a
feat(infra): computed livedata ( #6091 )
2024-03-13 06:26:05 +00:00
EYHN
cacc2d311e
feat(infra): livedata flatten ( #6083 )
2024-03-13 06:06:18 +00:00
EYHN
05b79aae89
fix(core): fix tags includes missing error ( #6096 )
...
fix https://toeverything.sentry.io/issues/5059796018/events/0899e77a3f6842088568b4cc42b814d7/
2024-03-13 02:43:28 +00:00
EYHN
eca35ded2f
fix(core): fix page priority load ( #6072 )
...
When refactoring, I planned to put the logic of loading current pages priority in `PageManager.open`, but I forgot, so the current page will not be loaded priority.
But currently `PageManager.open` has been used in many places, but only one priority page can be set, so the logic of setting the priority page is still placed in the detail page.
2024-03-12 05:09:14 +00:00
EYHN
3672366fea
fix(core): fix missing windows controls ( #6067 )
...
fix #6064
2024-03-12 02:43:45 +00:00
EYHN
ba4637a6bd
fix(core): add view error boundary ( #6036 )
2024-03-11 07:09:47 +00:00
EYHN
5091174da2
fix(core): remove unexpected loading ( #6035 )
2024-03-09 15:01:18 +00:00
EYHN
ae22d6469d
fix(core): fix unit test ( #6040 )
2024-03-09 15:01:16 +00:00
EYHN
633a5bab53
fix(core): fix cmdk not show current page ( #6031 )
2024-03-06 06:31:38 +00:00
EYHN
dce3b59c52
fix(core): fix falsy e2e ( #6027 )
2024-03-05 15:25:19 +00:00
EYHN
5d8dea084c
fix(core): fix journal missing after refresh ( #6022 )
2024-03-05 11:42:09 +00:00
EYHN
ceec54b423
fix(docs): fix bug-report template ( #6020 )
2024-03-05 09:52:57 +00:00
EYHN
e9d51f6c96
fix(component): journal header button no responce ( #6021 )
2024-03-05 09:40:19 +00:00
EYHN
7c55472b78
docs: update bug-report.yml ( #6018 )
2024-03-05 16:27:14 +08:00
EYHN
7c76c25a9c
refactor(core): new back&forward button base on workbench ( #6012 )
...
# feature:
## In Browser:
- hidden back&forward button in sidebar.
- back and forward is equal with `window.history.back()` `window.history.forward()`
## In Desktop:
- Back and forward can be controlled through the sidebar, cmdk, and shortcut keys.
- back and forward act on the currently **active** view.
- buttons change disable&enable style based on current active view history
# Refactor:
Move app-sidebar and app-container from @affine/component to @affine/core
2024-03-05 07:01:24 +00:00
EYHN
a9be19ce6c
fix(core): fix style break when scroll to block ( #6001 )
2024-03-04 11:43:10 +00:00
EYHN
d935cf9d4d
fix(core): dont break workspace when page load failed ( #5988 )
2024-03-04 11:32:56 +00:00
EYHN
c599715963
feat(core): split right sidebar ( #5971 )
...
https://github.com/toeverything/AFFiNE/assets/13579374/c846c069-aa32-445d-b59b-b773a9b05ced
Now each view has a general container, the yellow area is the general container part, and the green part is the routing specific part.

2024-03-04 06:42:12 +00:00
EYHN
de939bb6f6
fix(core): fix page mode scroll bar ( #5955 )
2024-03-01 04:46:15 +00:00
EYHN
a231884d9e
fix(storybook): fix storybook test ( #5970 )
2024-03-01 02:30:04 +00:00
EYHN
78ce30db69
fix(core): fix editor sidebar ( #5965 )
2024-02-29 13:59:20 +00:00
EYHN
fa534869e1
feat(core): new onboarding template ( #5951 )
2024-02-29 06:02:32 +00:00
EYHN
606397e319
feat(core): workbench system ( #5837 )
2024-02-27 04:14:07 +00:00
EYHN
5cd488fe1d
refactor(core): remove collection atom ( #5832 )
2024-02-27 03:50:56 +00:00
EYHN
ad9b0303c4
refactor(core): refactor atom to use di ( #5831 )
...
To support multiple instances, this PR removes some atoms and implements them using the new DI system.
removed atom
- `pageSettingsAtom`
- `currentPageIdAtom`
- `currentModeAtom`
2024-02-27 03:50:53 +00:00
EYHN
0dabb08217
chore: create default user for devcontainer ( #5917 )
...
## **Type**
enhancement
___
## **Description**
- Added a command to `.devcontainer/build.sh` to create a default user (`affine`) in the database for development purposes.
- Introduced error handling in `.devcontainer/setup-user.sh` to ensure the script stops on the first error.
- Modified the git fetch command in `.devcontainer/setup-user.sh` to fetch the `canary` branch from `origin` with a depth of 1, optimizing the setup process.
___
## **Changes walkthrough**
<table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement
</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>build.sh</strong><dd><code>Add Default User Creation to Dev Container Build Script</code> </dd></summary>
<hr>
.devcontainer/build.sh
<li>Added command to create a default user with username and password <br>'affine'.<br> <li> Ensured database push command is followed by a newline.<br>
</details>
</td>
<td><a href="https:/toeverything/AFFiNE/pull/5917/files#diff-165b66803397b501866b23a0532418e9ad3eb2ab642274f9679383c76d18136f">+4/-1</a> </td>
</tr>
<tr>
<td>
<details>
<summary><strong>setup-user.sh</strong><dd><code>Enhance User Setup Script with Error Handling and Specific Git Fetch</code></dd></summary>
<hr>
.devcontainer/setup-user.sh
<li>Introduced error handling with 'set -e' to stop on first error.<br> <li> Modified 'git fetch' to specifically fetch 'canary' branch from <br>'origin' with depth of 1.<br>
</details>
</td>
<td><a href="https:/toeverything/AFFiNE/pull/5917/files#diff-8c5e76719e2ff0a3bf2b59d108dc9cf88bdae00c317728454cfa5108f2fc76af">+3/-1</a> </td>
</tr>
</table></td></tr></tr></tbody></table>
___
> ✨ **PR-Agent usage**:
>Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions
2024-02-27 03:32:03 +00:00
EYHN
6ccc4f1501
chore: start dev server on devcontainer ( #5914 )
2024-02-26 13:47:06 +00:00
EYHN
ee4918b3b8
chore: update devcontainer build.sh ( #5912 )
2024-02-26 13:47:00 +00:00
EYHN
3f7f78c8f4
fix(core): fix app boot speed ( #5885 )
2024-02-23 07:07:03 +00:00
EYHN
0fff5588e6
fix(core): disable sidebar user select ( #5862 )
...
close #5846
2024-02-22 07:58:14 +00:00
EYHN
799fa9cfa6
fix(workspace): fix sync stuck ( #5762 )
...
* remove MultipleBatchSyncSender
* add timeout (30 seconds) on socket.emit
2024-02-01 06:58:09 +00:00
EYHN
329fc19852
refactor(infra): migrate to new infra ( #5565 )
2024-01-30 07:16:39 +00:00
EYHN
1e3499c323
feat(infra): page infra ( #5618 )
2024-01-30 06:31:26 +00:00
EYHN
2e71c980cf
feat(infra): new workspace infra ( #5617 )
...
This PR copying @affine/workspace into common/infra, and adding definitions for services and unit tests.
2024-01-30 06:31:24 +00:00
EYHN
4f7e0d012d
chore: fix vitest error on tinykeys ( #5693 )
2024-01-30 06:31:21 +00:00
EYHN
88cd83fed1
feat(infra): standard lifecycle service ( #5564 )
2024-01-30 06:31:19 +00:00
EYHN
b3a8e62984
feat(infra): standard storage service ( #5563 )
2024-01-30 06:31:15 +00:00
EYHN
48eb6c50e1
feat(infra): di container ( #5497 )
...
docs: https://insider.affine.pro/share/055f9c4b-497a-43ec-a1c9-29d5baf184b9/N785YJ__oLMb2fUaLOv-k
2024-01-30 06:31:13 +00:00
EYHN
c9f8e49f75
feat(infra): livedata ( #5562 )
...
LiveData is a reactive data type.
## basic usage
@example
```ts
const livedata = new LiveData(0); // create livedata with initial value
livedata.next(1); // update value
console.log(livedata.value); // get current value
livedata.subscribe(v => { // subscribe to value changes
console.log(v); // 1
});
```
## observable
LiveData is a rxjs observable, you can use rxjs operators.
@example
```ts
new LiveData(0).pipe(
map(v => v + 1),
filter(v => v > 1),
...
)
```
NOTICE: different from normal observable, LiveData will always emit the latest value when you subscribe to it.
## from observable
LiveData can be created from observable or from other livedata.
@example
```ts
const A = LiveData.from(
of(1, 2, 3, 4), // from observable
0 // initial value
);
const B = LiveData.from(
A.pipe(map(v => 'from a ' + v)), // from other livedata
'' // initial value
);
```
NOTICE: LiveData.from will not complete when the observable completes, you can use `spreadComplete` option to change
this behavior.
## Why is it called LiveData
This API is very similar to LiveData in Android, as both are based on Observable, so I named it LiveData.
2024-01-30 06:31:11 +00:00
EYHN
74a3a795bd
fix(workspace): check session before get workspaces ( #5621 )
2024-01-18 04:46:52 +00:00
EYHN
d1c2b2a7b0
fix(core): workspace not found after import ( #5571 )
...
close TOV-393
2024-01-11 09:47:24 +00:00