Skip to content

Commit

Permalink
Revise flow types for React Router example. Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nhunzaker committed Jun 19, 2017
1 parent b00c415 commit 6e24813
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 21 deletions.
5 changes: 0 additions & 5 deletions examples/react-router/.flowconfig

This file was deleted.

19 changes: 15 additions & 4 deletions examples/react-router/app/models/lists.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
import { set } from 'microcosm'
/**
* @flow
*/

import type Presenter from 'microcosm/addons/presenter'
import { set } from 'microcosm' // eslint-ignore-line

type Snapshot = { [string]: * }

interface Model {
call(presenter: Presenter, state: Snapshot, repo: Microcosm): *
}

export class ListsWithCounts implements Model {
call(_presenter, state) {
call(_presenter: Presenter, state: Snapshot) {
const { lists, items } = state

return lists.map(function(list) {
Expand All @@ -19,7 +30,7 @@ export class List implements Model {
this.id = id
}

call(_presenter, state) {
call(_presenter: Presenter, state: Snapshot) {
const { lists } = state

return lists.find(list => list.id === this.id)
Expand All @@ -33,7 +44,7 @@ export class ListItems implements Model {
this.id = id
}

call(_presenter, state) {
call(_presenter: Presenter, state: Snapshot) {
const { items } = state

return items.filter(item => item.list === this.id)
Expand Down
12 changes: 0 additions & 12 deletions examples/react-router/flow/model.js

This file was deleted.

0 comments on commit 6e24813

Please sign in to comment.