-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persistence Manager #733
Closed
Closed
Persistence Manager #733
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c4355ea
Persistence Manager
Ryanseanlee b39e1d2
Merge branch 'develop' into persistenceManager
Ryanseanlee 40150c7
Greg CR
Ryanseanlee d26f88d
typo
Ryanseanlee 4075725
Pass value through callback
Ryanseanlee 69be4ce
Add view tree getter for app specific custom component.
Ryanseanlee 560d1ec
Merge branch 'develop' into persistenceManager
Ryanseanlee da6715d
Greg CR
Ryanseanlee e925b41
wait for PersistenceManager to be loaded before rendering
Ryanseanlee 4d4e13d
typo
Ryanseanlee 7ce8105
Remove persistence grid
Ryanseanlee 3ed1236
Merge branch 'develop' into persistenceManager
Ryanseanlee 2bd2697
Replace Persistence -> View
Ryanseanlee 0dafbce
Replace Persistence -> View
Ryanseanlee b3126d1
add isWriteStateImmediately getter on persistenceProvider
Ryanseanlee cb1af4c
Merge branch 'develop' into persistenceManager
Ryanseanlee 4c3041e
clear state clears filter chooser model favorites
Ryanseanlee 1e3b470
greg CR
Ryanseanlee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
import {hframe} from '@xh/hoist/cmp/layout'; | ||
import {hframe, placeholder} from '@xh/hoist/cmp/layout'; | ||
import {creates, hoistCmp} from '@xh/hoist/core'; | ||
import {panel} from '@xh/hoist/desktop/cmp/panel'; | ||
import {detailPanel} from './detail/DetailPanel'; | ||
import {gridPanel} from './GridPanel'; | ||
import {mapPanel} from './MapPanel'; | ||
import {PortfolioPanelModel} from './PortfolioPanelModel'; | ||
|
||
export const portfolioPanel = hoistCmp.factory({ | ||
export const portfolioPanel = hoistCmp.factory<PortfolioPanelModel>({ | ||
model: creates(PortfolioPanelModel), | ||
|
||
render() { | ||
render({model}) { | ||
return panel({ | ||
mask: 'onLoad', | ||
items: [hframe(gridPanel(), mapPanel()), detailPanel()] | ||
mask: [model.loadModel, model.initTask], | ||
items: model.viewManagerModel | ||
? [hframe(gridPanel(), mapPanel()), detailPanel()] | ||
: placeholder() | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, this is an annoying amount of boilerplate you had to write! I wonder if there'd be a way to generalize this and build a higher order component / model to avoid some of this. Just brainstorming - what if the
PersistenceManager
component was a container that accepted a single child component that it would not render until it was done initializing. Big issue here is that ideally the child wouldcreate
its model, so that it would not be constructed until the manager finished initializing. BUT we would need a reference to that model in order to wire it. Wonder if we could usemodelRef
to do that... but we wouldn't want whatever we do to be even more complicated / harder to reason about than what you have here...Sorry for the flight of ideas - will think more on this, and maybe we can brainstorm together.