Building navigation menu
We are working on building a navigation element that has the following behaviors:
1. A switcher that changes the top level list of elements to pick between a nested list and a flat list.
2. When the list is nested, selecting an element will unfold the elements below it.
3. When the user selects one of the nested elements it slides to the right to show the final set of element.
Making ajax calls to data
1. Make action attached to metadata.
- make constant in constants using makeConstant.
- make action in actions 'requestAllMetadata'.
2. On sidebar: in componentDidMount add requestAllMetadata as a prop. Add it to the mapping that will get passed up to the state.
3. Redux-logic: middleware, provides hooks to validate before data goes into the store.
- everything that has to do with event business logic goes into logics. We are working in the metadata branch of state.
- using axios to make ajax calls.
* inject parameter even when you don't need it so you can mock it in tests.
Leave a Reply.