Skip to content

Create Pages class for routing capabilities #29

@idangoldman

Description

@idangoldman

Similar structure to page.js, but different use and implementation.

General example:

export default class Page {
  static cache = []
  static log = []
  
  // Callbacks: params, query, meta
  static route(uri = '', ...callbacks) {}
  static history() {}
  
  forward(url = '') {}
  next(url = '') {
    return this.forward(url)
  }
  
  backward(url = '') {}
  back(url = '') {
    return this.backward(url)
  }
  
  rewrite(url = '') {}
  redirect(url = '') {}
  
  // position: px, percentage, selector
  scroll(position = '') {}
}

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions