Skip to content

Commit

Permalink
dont duplicate useBlobity react hook
Browse files Browse the repository at this point in the history
  • Loading branch information
gmrchk committed Oct 31, 2021
1 parent 768b415 commit 4cbed72
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/useBlobity.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
import Blobity, { Options } from './Blobity';
import { useEffect, useRef } from 'react';

export default (options: Partial<Options>) => {
const instance = useRef<Blobity | null>(null);

useEffect(() => {
if (!instance.current) {
instance.current = new Blobity(options);
}
}, []);

return instance;
};
export { default } from './react/useBlobity';

0 comments on commit 4cbed72

Please sign in to comment.