{"size": 587, "ext": "js", "max_stars_repo_path": "blocks/comparebar/src/footer/footer.js", "max_stars_repo_name": "cleber-engineer/rex", "max_stars_repo_stars_event_min_datetime": "2020-08-11T11:13:25.000Z", "max_stars_repo_stars_event_max_datetime": "2020-09-04T20:22:02.000Z", "max_issues_repo_path": "blocks/comparebar/src/footer/footer.js", "max_issues_repo_name": "cleber-engineer/rex", "max_issues_repo_issues_event_min_datetime": "2020-12-13T06:03:00.000Z", "max_issues_repo_issues_event_max_datetime": "2020-12-13T06:03:00.000Z", "max_forks_repo_path": "blocks/comparebar/src/footer/footer.js", "max_forks_repo_name": "cleber-engineer/rex", "max_forks_repo_forks_event_min_datetime": "2020-07-07T11:29:50.000Z", "max_forks_repo_forks_event_max_datetime": "2020-07-22T21:12:07.000Z"}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": 2, "avg_line_length": 18.34375, "max_line_length": 50, "alphanum_fraction": 0.5928449744}
import * as f from '@kuba/f'
import { paint } from '@kuba/h'
import { redirectTo, urlFor } from '@kuba/router'
import actions from './actions'
import component from './component'

@paint(component)
@actions
class Footer {
  get href () {
    return urlFor('compare')
  }

  get valid () {
    return f
      .from(localStorage.getItem('_kuba.compare'))
      .pipe(f.or(f.__, '[]'))
      .pipe(JSON.parse)
      .pipe(f.slice(f.__, -2))
      .pipe(f.len)
      .pipe(f.equal(2))
      .done()
  }

  redirect () {
    redirectTo('compare')
    return this
  }
}

export default Footer
