Browse Source

fix: re-exposing store in component api, as form depends on it

master
Michael Shanks 6 years ago
parent
commit
7fe7c9b286
  1. 1
      packages/client/src/state/bbComponentApi.js
  2. 4
      packages/client/src/state/store.js

1
packages/client/src/state/bbComponentApi.js

@ -47,6 +47,7 @@ export const bbFactory = ({
setBinding: setBindableComponentProp(treeNode),
api,
parent,
store: store.getStore(treeNode.contextStoreKey),
// these parameters are populated by screenRouter
routeParams: () => store.getState()["##routeParams"],
}

4
packages/client/src/state/store.js

@ -94,6 +94,9 @@ const set = (value, dataProviderId, childIndex) =>
const getState = contextStoreKey =>
contextStoreKey ? contextStores[contextStoreKey].state : rootState
const getStore = contextStoreKey =>
contextStoreKey ? contextStores[contextStoreKey] : rootStore
export default {
subscribe,
update,
@ -101,4 +104,5 @@ export default {
getState,
create,
contextStoreKey,
getStore,
}

Loading…
Cancel
Save