Skip to content

Commit

Permalink
Remove string from reduxRootSelector in ApolloClient constructo…
Browse files Browse the repository at this point in the history
…r is it was misleading (#1891)

* allow `reduxRootSelector ` to be used as a reduxRootKey

* cleanup string

* remove redundant test
  • Loading branch information
pfrendo authored and shadaj committed Jul 13, 2017
1 parent 09e4e27 commit fc826c3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion src/ApolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export default class ApolloClient implements DataProxy {

constructor(options: {
networkInterface?: NetworkInterface | ObservableNetworkInterface,
reduxRootSelector?: string | ApolloStateSelector,
reduxRootSelector?: ApolloStateSelector,
initialState?: any,
dataIdFromObject?: IdGetter,
ssrMode?: boolean,
Expand Down
5 changes: 0 additions & 5 deletions test/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,6 @@ describe('client', () => {
);
});

it('should not allow passing reduxRootSelector as a string', () => {
const reduxRootSelector = 'testApollo';
assert.throws( () => new ApolloClient({ reduxRootSelector }));
});

it('should throw an error if "reduxRootSelector" is provided and the client tries to create the store', () => {
const reduxRootSelector = (state: any) => state.testApollo;
const client = new ApolloClient({
Expand Down

0 comments on commit fc826c3

Please sign in to comment.