@t7/utils
Version:
Utility methods for T7 components.
27 lines (20 loc) • 354 B
JavaScript
// Dependencies.
import { path } from './'
/*
// Used like so...
navigate([
'users',
userId,
'items',
itemId
])
// Which goes to...
'#/users/123/items/456'
*/
// Helper for page navigation.
const navigate = (...args) => {
// Change hash.
window.location.hash = path(args)
}
// Expose function.
export default navigate