Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
feat: add useTransitionState hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Barnes committed Mar 28, 2019
1 parent cf0bc7a commit 5b16766
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/context/createTransitionContext.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createContext } from "react";

const { Provider, Consumer } = createContext();
const { Provider: PublicProvider, Consumer: PublicConsumer } = createContext();
const publicContext = createContext();
const { Provider: PublicProvider, Consumer: PublicConsumer } = publicContext;

export { Provider, Consumer, PublicProvider, PublicConsumer };
export { Provider, Consumer, PublicProvider, PublicConsumer, publicContext };
6 changes: 6 additions & 0 deletions src/hooks/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { useContext } from "react";
import { publicContext } from "../context/createTransitionContext";

const useTransitionState = () => useContext(publicContext);

export { useTransitionState };

0 comments on commit 5b16766

Please sign in to comment.