mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-24 04:27:27 +08:00
refactor(hooks): reduce null types (#3111)
(cherry picked from commit 8b5d997322)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { assertExists } from '@blocksuite/global/utils';
|
||||
import type { Page, Workspace } from '@blocksuite/store';
|
||||
import { useMemo } from 'react';
|
||||
|
||||
@@ -6,7 +5,6 @@ export function useBlockSuiteWorkspaceHelper(blockSuiteWorkspace: Workspace) {
|
||||
return useMemo(
|
||||
() => ({
|
||||
createPage: (pageId?: string): Page => {
|
||||
assertExists(blockSuiteWorkspace);
|
||||
return blockSuiteWorkspace.createPage({ id: pageId });
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user