refactor: convert function expressions to declarations (#4926)
This commit is contained in:
committed by
GitHub
parent
c0236536dd
commit
141a2eba56
@ -2,11 +2,16 @@ import { createHashHistory } from 'history';
|
||||
|
||||
const history = createHashHistory();
|
||||
|
||||
export const navigateToCollection = (collectionName: string) =>
|
||||
history.push(`/collections/${collectionName}`);
|
||||
export const navigateToNewEntry = (collectionName: string) =>
|
||||
history.replace(`/collections/${collectionName}/new`);
|
||||
export const navigateToEntry = (collectionName: string, slug: string) =>
|
||||
history.replace(`/collections/${collectionName}/entries/${slug}`);
|
||||
export function navigateToCollection(collectionName: string) {
|
||||
return history.push(`/collections/${collectionName}`);
|
||||
}
|
||||
|
||||
export function navigateToNewEntry(collectionName: string) {
|
||||
return history.replace(`/collections/${collectionName}/new`);
|
||||
}
|
||||
|
||||
export function navigateToEntry(collectionName: string, slug: string) {
|
||||
return history.replace(`/collections/${collectionName}/entries/${slug}`);
|
||||
}
|
||||
|
||||
export default history;
|
||||
|
Reference in New Issue
Block a user