18 lines
510 B
TypeScript
Raw Normal View History

2019-10-23 13:58:54 +01:00
import { createHashHistory } from 'history';
2016-07-15 15:05:04 -03:00
const history = createHashHistory();
2016-07-15 15:05:04 -03:00
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}`);
}
2020-06-18 10:11:37 +03:00
2016-07-15 15:05:04 -03:00
export default history;