Redux-orm linking constraints on dispatch

129 Views Asked by At

Trying to understand redux-orm . Have been reading up on and https://github.com/tommikaikkonen/redux-orm and http://blog.isquaredsoftware.com/2016/10/practical-redux-part-1-redux-orm-basics/

I have two classes Author and Book

Author

Book

Now when i dispatch an CREATE_AUTHOR action creating author details similarly i dispatch another action with type CREATE_BOOK adding Book details . Now how do i link the Author and its associated books ? or if i am creating a Book first how to i add its Author ?

1

There are 1 best solutions below

0
On

The answer lies in the documentation itself here. You need to create another action like ADD_AUTHOR_TO_BOOK that would do the linking for you