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
142
Issues
142
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
gargantext
purescript-gargantext
Commits
ebb67a01
Commit
ebb67a01
authored
Mar 29, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[toestand] some small refactorings
parent
d5c430c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
9 deletions
+13
-9
Data.purs
src/Gargantext/Components/App/Data.purs
+7
-7
Tree.purs
src/Gargantext/Components/Forest/Tree.purs
+4
-2
Router.purs
src/Gargantext/Components/Router.purs
+2
-0
No files found.
src/Gargantext/Components/App/Data.purs
View file @
ebb67a01
...
...
@@ -13,10 +13,10 @@ import Gargantext.Utils.Toestand as T2
type App =
{ backend :: Maybe Backend
, handed :: Handed
, forestOpen :: OpenNodes
,
reloadRoot :: Int
,
handed :: Handed
, reloadForest :: Int
, reloadRoot :: Int
, route :: AppRoute
, sessions :: Sessions
, showCorpus :: Boolean
...
...
@@ -26,11 +26,11 @@ type App =
emptyApp :: App
emptyApp =
{ backend: Nothing
, handed: RightHanded
, route: Home
, forestOpen: Set.empty
,
reloadRoot: T2.newReloa
d
,
handed: RightHande
d
, reloadForest: T2.newReload
, reloadRoot: T2.newReload
, route: Home
, sessions: Sessions.empty
, showCorpus: false
, showLogin: false
...
...
@@ -38,10 +38,10 @@ emptyApp =
type Boxes =
{ backend :: T.Box (Maybe Backend)
, handed :: T.Box Handed
, forestOpen :: T.Box OpenNodes
,
reloadRoot :: T.Box T2.Reloa
d
,
handed :: T.Box Hande
d
, reloadForest :: T.Box T2.Reload
, reloadRoot :: T.Box T2.Reload
, route :: T.Box AppRoute
, sessions :: T.Box Sessions
, showCorpus :: T.Box Boolean
...
...
src/Gargantext/Components/Forest/Tree.purs
View file @
ebb67a01
...
...
@@ -73,10 +73,12 @@ treeLoader = R.createElement treeLoaderCpt
treeLoaderCpt :: R.Component LoaderProps
treeLoaderCpt = here.component "treeLoader" cpt where
-- treeLoaderCpt :: R.Memo LoaderProps
-- treeLoaderCpt = R.memo (here.component "treeLoader" cpt) memoCmp where
-- memoCmp ({ root: t1 }) ({ root: t2 }) = t1 == t2
cpt p@{ root, session } _ = do
app <- T.useLive T.unequal p.reloadRoot
reload <- T.useLive T.unequal p.reload
let fetch _ = getNodeTree session root
let fetch { root: r } = getNodeTree session r
useLoader { app, root } fetch loaded where
loaded tree' = tree props where
props = Record.merge common extra where
...
...
src/Gargantext/Components/Router.purs
View file @
ebb67a01
...
...
@@ -58,8 +58,10 @@ routerCpt = here.component "router" cpt where
let session = R.createContext (unsafeCoerce {})
let sessionProps sId = Record.merge { session, sessionId: sId } props
let sessionNodeProps sId nId = Record.merge { nodeId: nId } $ sessionProps sId
showLogin <- T.useLive T.unequal boxes.showLogin
route' <- T.useLive T.unequal boxes.route
pure $ R.fragment
[ if showLogin then login' boxes else H.div {} []
, case route' of
...
...
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