mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-29 00:06:09 +08:00
style: enable rxjs/finnish (#6276)
chore(infra): use finnish notation for observables do rename
This commit is contained in:
@@ -26,7 +26,7 @@ export function createApplicationMenu() {
|
||||
label: `About ${app.getName()}`,
|
||||
click: async () => {
|
||||
await showMainWindow();
|
||||
applicationMenuSubjects.openAboutPageInSettingModal.next();
|
||||
applicationMenuSubjects.openAboutPageInSettingModal$.next();
|
||||
},
|
||||
},
|
||||
{ type: 'separator' },
|
||||
@@ -52,7 +52,7 @@ export function createApplicationMenu() {
|
||||
click: async () => {
|
||||
await initAndShowMainWindow();
|
||||
// fixme: if the window is just created, the new page action will not be triggered
|
||||
applicationMenuSubjects.newPageAction.next();
|
||||
applicationMenuSubjects.newPageAction$.next();
|
||||
},
|
||||
},
|
||||
{ type: 'separator' },
|
||||
|
||||
@@ -12,14 +12,14 @@ export const applicationMenuEvents = {
|
||||
* File -> New Doc
|
||||
*/
|
||||
onNewPageAction: (fn: () => void) => {
|
||||
const sub = applicationMenuSubjects.newPageAction.subscribe(fn);
|
||||
const sub = applicationMenuSubjects.newPageAction$.subscribe(fn);
|
||||
return () => {
|
||||
sub.unsubscribe();
|
||||
};
|
||||
},
|
||||
openAboutPageInSettingModal: (fn: () => void) => {
|
||||
const sub =
|
||||
applicationMenuSubjects.openAboutPageInSettingModal.subscribe(fn);
|
||||
applicationMenuSubjects.openAboutPageInSettingModal$.subscribe(fn);
|
||||
return () => {
|
||||
sub.unsubscribe();
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
export const applicationMenuSubjects = {
|
||||
newPageAction: new Subject<void>(),
|
||||
openAboutPageInSettingModal: new Subject<void>(),
|
||||
newPageAction$: new Subject<void>(),
|
||||
openAboutPageInSettingModal$: new Subject<void>(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user