Tags: neurosnap/starfx
Tags
fix(thunk): run thunk supervisors immediately on register For whatever reason, dispatching actions to register all the supervisor thunks was too slow and causing a regression with prod systems. This reverts part of the register function to how it used to work. To be more specific, it calls the supervisor functions immediately in a `parallel` call.
refactor: enhanced thunk registry system (#44) The current registry system for thunks works like this: - User calls `const thunks = createThunks()` - User creates **all** thunks `const go = thunks.create("go")` - User registers thunks `store.run(thunks.bootup)` However, there's a caveat with this implementation: all thunks must be created before `store.run` is called. Further, since thunks are created at the module-level, if the module that exports those thunks isn't loaded before `thunk.bootup` is called then those thunks are silently ignored. This change will make it so it doesn't matter when a thunk is created, we will "lazy load" it. We still require `store.run(thunks.bootup)` to be called -- because we need access to the store and won't have it when creating a thunk. We are also sending an error whenever a thunk is dispatched without it being registered which should help ensure thunks get properly registered. We also changed the name of `thunks.bootup` to `thunks.register` to make it more clear that this is a registry system.
PreviousNext