Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Fix flow types for createRPCReducer interface #108

Merged
merged 1 commit into from
Jul 31, 2018

Conversation

ganemone
Copy link
Contributor

This fixes issues with the createRPCReducer interface when working with flow types by using generics rather than the existential operator * whenever possible. This allows you to create a flow typed rpc reducer using the Reducer type helper from redux. For example:

import type {Reducer} from 'redux';
import {createRPCReducer} from 'fusion-rpc-redux';

const StateType = {|
  a: string,
  b: boolean
|};

const ActionType = {|
  type: string,
  payload: {
    a: string,
    b : boolean
  }
|}

const reducer: Reducer<StateType, ActionType> = createRPCReducer('rpcId', {
  // ...
});

@codecov
Copy link

codecov bot commented Jul 31, 2018

Codecov Report

Merging #108 into master will not change coverage.
The diff coverage is 91.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #108   +/-   ##
=======================================
  Coverage   96.66%   96.66%           
=======================================
  Files           1        1           
  Lines          60       60           
  Branches       16       12    -4     
=======================================
  Hits           58       58           
  Misses          1        1           
  Partials        1        1
Impacted Files Coverage Δ
src/index.js 96.66% <91.66%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cce3127...c386d81. Read the comment docs.

Copy link
Contributor

@KevinGrandon KevinGrandon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job on the flow fixture tests!

@@ -1,6 +1,7 @@
[ignore]
.*/node_modules/.*[^(package)]\.json$
<PROJECT_ROOT>/dist/.*
<PROJECT_ROOT>/src/fixtures/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question - Why is this needed if we're running flow in the testing suite?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixtures are run separately, and some of them are intended to fail. We want that to show up in tests but not when running flow on the project

@ganemone ganemone merged commit 7915c09 into fusionjs:master Jul 31, 2018
@AlexMSmithCA AlexMSmithCA mentioned this pull request Aug 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants