You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CoreID/app/assets/app/service/Action.service.js

17 lines
462 B

4 years ago
import { location_service } from './Location.service.js'
class ActionService {
async perform({ text, action, ...args }) {
if ( action === 'redirect' ) {
if ( args.next ) {
4 years ago
return location_service.redirect(args.next, args.delay || 1500)
4 years ago
}
} else {
throw new TypeError(`Unknown action type: ${action}`)
}
}
}
const action_service = new ActionService()
export { action_service }