Skip to content

Commit

Permalink
internal fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bySabi committed Apr 6, 2019
1 parent 61946f4 commit 3071e6b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "garfio",
"version": "0.1.5",
"version": "0.1.6",
"description": "extending Hookleton Pattern namespaces and more",
"main": "lib/index.js",
"react-native": "lib/index.js",
Expand Down Expand Up @@ -48,7 +48,7 @@
"url": "https://github.com/bySabi/garfio/issues"
},
"dependencies": {
"hookleton": "^0.4.3"
"hookleton": "^0.4.6"
},
"devDependencies": {
"@babel/core": "^7.3.4",
Expand Down
4 changes: 2 additions & 2 deletions src/simple.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useMemo, useLayoutEffect } from 'react';
import { useMemo, useEffect } from 'react';
import { createHook as createHookCore } from 'hookleton';

export function createHook() {
const hook = createHookCore.apply(null, arguments);
let h;
function use() {
const host = useMemo(() => !h && (h = true), []);
return host ? (useLayoutEffect(() => () => (h = false), []), hook.use()) : hook();
return host ? (useEffect(() => () => (h = false), []), hook.use()) : hook();
}
function useFn() {
return use();
Expand Down

0 comments on commit 3071e6b

Please sign in to comment.