Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
e1056935
Verified
Commit
e1056935
authored
Apr 26, 2024
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[graph] edge weight work with useTransition, still doesn't work correctly
parent
63692972
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
6 deletions
+27
-6
RangeControl.purs
...antext/Components/GraphExplorer/Toolbar/RangeControl.purs
+3
-2
Reactix.js
src/Gargantext/Utils/Reactix.js
+7
-3
Reactix.purs
src/Gargantext/Utils/Reactix.purs
+17
-1
No files found.
src/Gargantext/Components/GraphExplorer/Toolbar/RangeControl.purs
View file @
e1056935
...
...
@@ -125,12 +125,13 @@ edgeWeightControlCpt = here.component "edgeWeightControl" cpt
, state
} _ = do
--
TODO
useTransition
--
transition <- R2.useTransition
let onChange' rng = do
-- here.log2 "[edgeWeightControl] debounce rng" rng
let _ = spy "debounce rng" rng
let _ = spy "debounce state" state
-- R2.startTransition transition (\_ -> T.write_ rng state)
T.write_ rng state
onChange = Debounce.debounce onChange' 1000
...
...
src/Gargantext/Utils/Reactix.js
View file @
e1056935
'use strict'
;
import
{
useTransition
}
from
'react'
;
export
function
_addRootElement
(
rootElem
)
{
document
.
body
.
insertBefore
(
rootElem
,
...
...
@@ -65,4 +63,10 @@ export function _scrollIntoView(el) {
}
export
const
useTransition
;
export
const
isPendingTransitionImpl
=
(
t
)
=>
()
=>
{
return
t
[
0
]();
}
export
const
startTransitionImpl
=
(
t
)
=>
(
f
)
=>
()
=>
{
return
t
[
1
](
f
);
}
src/Gargantext/Utils/Reactix.purs
View file @
e1056935
...
...
@@ -652,4 +652,20 @@ setInputValue elNullableRef val = case toMaybe (R.readRef elNullableRef) of
-- TODO useTransition?
foreign import data Transition :: Type
foreign import useTransitionImpl ::
-- foreign import useTransitionImpl :: R.Hooks Transition
-- useTransition :: R.Hooks Transition
-- useTransition = useTransitionImpl
useTransition :: R.Hooks Transition
useTransition = hook $ \_ -> pure $ react ... "useTransition" $ []
foreign import isPendingTransitionImpl :: Transition -> R.Hooks Boolean
isPendingTransition :: Transition -> R.Hooks Boolean
isPendingTransition = isPendingTransitionImpl
foreign import startTransitionImpl :: Transition -> (Unit -> Effect Unit) -> Effect Unit
startTransition :: Transition -> (Unit -> Effect Unit) -> Effect Unit
startTransition = startTransitionImpl
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment