Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 749 Bytes

CrossStore.md

File metadata and controls

27 lines (22 loc) · 749 Bytes

Cross Store

We advocate the use of iFlow to combine the store to form a store tree, the ideal result is that each node in the store can only reference and invoke its child node state or actions, but if you have cross store requirements, Then we recommend that each time the cross store references and invokes another store, only the call action across the store is supported, and the store must be combined if the state is to be referenced across the store.

For example:

const store1 = iFlow({
  foo: {
    bar: ['test']
  },
  actionFoo(){
    //
  }
}).create()

const store2 = iFlow({
  foo: {
    bar: store1
  },
  test(){
    store1.actionFoo()
  }
}).create()

⚠️Note: iFlow does not support pipe combinations