Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
dataDidChange and afterDeploy
Browse files Browse the repository at this point in the history
  • Loading branch information
abz53378 committed May 24, 2018
1 parent 4cad6f4 commit b0af5b1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
10 changes: 10 additions & 0 deletions docs/index.js
Expand Up @@ -51,6 +51,14 @@ class CMSExample extends React.Component {
});
}

dataDidChange = (dataChanged) => {
console.log(dataChanged);
}

afterDeploy = () => {
console.log('deployed');
}

render() {
const baseUrl = "/docs";
const {cannerSchema} = schema;
Expand Down Expand Up @@ -82,6 +90,8 @@ class CMSExample extends React.Component {
baseUrl={baseUrl}
history={history}
connector={this.connector}
afterDeploy={this.afterDeploy}
dataDidChange={this.dataDidChange}
layouts={{
Tabs
}}
Expand Down
7 changes: 6 additions & 1 deletion src/action/actionManager.js
Expand Up @@ -50,7 +50,12 @@ export class ActionManager implements ActionManagerDef {
}
}

getActions = (key: string, id?: string) => {
getActions = (key?: string, id?: string) => {
if (!key) {
return Object.keys(this.store).reduce((result, key) => {
return result.concat(this.getActions(key));
}, []);
}
const item = get(this.store, key);
if (item instanceof ObjectPattern) {
return item.getActions();
Expand Down
2 changes: 1 addition & 1 deletion src/components/Provider.js
Expand Up @@ -53,7 +53,7 @@ export default class Provider extends React.PureComponent<Props, State> {
updateDataChanged = () => {
const actions = this.actionManager.getActions();
let dataChanged = groupBy(actions, (action => action.payload.key));
mapValues(dataChanged, value => {
dataChanged = mapValues(dataChanged, value => {
if (value[0].type === 'UPDATE_OBJECT') {
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/index.js
Expand Up @@ -32,8 +32,8 @@ type Props = {
},
connector: any,
resolver: ?Object,
dataDidChange: void => void,
afterDeploy: void => void,
dataDidChange: Object => void,
afterDeploy: Object => void,
children: React.ChildrenArray<React.Node>,
client: ApolloClient,
imageServiceConfigs: Object,
Expand Down

0 comments on commit b0af5b1

Please sign in to comment.