Skip to content

Commit

Permalink
refactor(tasks): move TasksContext to singletons
Browse files Browse the repository at this point in the history
  • Loading branch information
binoy14 committed Apr 29, 2024
1 parent 2bb6668 commit 9a8ed79
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions packages/sanity/src/_singletons/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ export * from './studio/workspaces/WorkspacesContext'
export * from './tasks/enabled/TasksEnabledContext'
export * from './tasks/mentionUser/MentionUserContext'
export * from './tasks/navigation/TasksNavigationContext'
export * from './tasks/tasks/TasksContext'
export * from './user-color/UserColorManagerContext'
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {createContext} from 'react'

import {type TasksContextValue} from './types'
import {TasksContextValue} from '../../../core/tasks/context/tasks/types'

/**
* @internal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {debounce} from 'lodash'
import {useCallback, useMemo, useState} from 'react'
import {TasksContext} from 'sanity/_singletons'

import {useTasksStore} from '../../store'
import {TasksContext} from './TasksContext'
import {type ActiveDocument, type TasksContextValue} from './types'

interface TasksProviderProps {
Expand Down
1 change: 0 additions & 1 deletion packages/sanity/src/core/tasks/context/tasks/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './TasksContext'
export * from './TasksProvider'
export * from './types'
export * from './useTasks'
2 changes: 1 addition & 1 deletion packages/sanity/src/core/tasks/context/tasks/useTasks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {useContext} from 'react'
import {TasksContext} from 'sanity/_singletons'

import {TasksContext} from './TasksContext'
import {type TasksContextValue} from './types'

/**
Expand Down

0 comments on commit 9a8ed79

Please sign in to comment.