Skip to content

Commit

Permalink
feat: export createInsightsClient for node env (#203)
Browse files Browse the repository at this point in the history
* feat: export getFunctionalInterface, AlgoliaAnalytics at node env for customization on user land

* chore: add codesandbox ci (#204)

* feat: export createInsightsClient

* chore: add codesandbox ci (#204)

* chore: rename parameter

* Apply suggestions from code review

Co-authored-by: Haroen Viaene <[email protected]>

Co-authored-by: Haroen Viaene <[email protected]>
  • Loading branch information
Eunjae Lee and Haroenv authored Jul 15, 2020
1 parent b24d66d commit 4f04869
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import AlgoliaAnalytics from "./insights";
import { getFunctionalInterface } from "./_getFunctionalInterface";
import { getRequesterForNode } from "./utils/getRequesterForNode";

const requestFn = getRequesterForNode();
const instance = new AlgoliaAnalytics({ requestFn });
const functionalInterface = getFunctionalInterface(instance);
export function createInsightsClient(requestFn) {
return getFunctionalInterface(new AlgoliaAnalytics({ requestFn }));
}

export default functionalInterface;
export default createInsightsClient(getRequesterForNode());

0 comments on commit 4f04869

Please sign in to comment.