-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This updates the `useJoinSpace` action to have the signature of `join : (spaceId, signer, options) => void`, instead of passing the `spaceId` as a hook parameter
- Loading branch information
1 parent
761fe1c
commit ba85af9
Showing
7 changed files
with
81 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
'use client' | ||
|
||
import type { Space } from '@river-build/sdk' | ||
import type { Spaces } from '@river-build/sdk' | ||
import { type ActionConfig, useAction } from './internals/useAction' | ||
import { useSyncAgent } from './useSyncAgent' | ||
|
||
export const useJoinSpace = (spaceId: string, config: ActionConfig<Space['join']> = {}) => { | ||
export const useJoinSpace = (config: ActionConfig<Spaces['joinSpace']> = {}) => { | ||
const sync = useSyncAgent() | ||
const space = sync.spaces.getSpace(spaceId) | ||
const { action: join, ...rest } = useAction(space, 'join', config) | ||
const { action: joinSpace, ...rest } = useAction(sync.spaces, 'joinSpace', config) | ||
|
||
return { | ||
join, | ||
joinSpace, | ||
...rest, | ||
} | ||
} |
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