Closed Andersos closed 7 years ago
So we need a way for FetchOrg to trigger changes in FetchSG. The solution Im looking into now is a way to subscribe to the redux store and look for changes in the orgid of the property of FetchOrg.
Looking for a library from this list https://github.com/markerikson/redux-ecosystem-links/blob/master/store.md#store-change-subscriptions
For the string interpolation lodash.template
is probably one of the easier ways to go about it:
From the docs
// Use the ES template literal delimiter as an "interpolate" delimiter.
// Disable support by replacing the "interpolate" delimiter.
var compiled = _.template('hello ${ user }!');
compiled({ 'user': 'pebbles' });
// => 'hello pebbles!'
Replaced my regex impl with the lodash template. Works really well.
Didnt go with the redux subscribe solution but @elisejakob suggested that we put the fetchSG block inside the fetchOrg block.
Fetch and display data from api around sentral godkjenning