Skip to content
This repository has been archived by the owner on Feb 14, 2023. It is now read-only.

2.2.0

Compare
Choose a tag to compare
@quisido quisido released this 18 Aug 18:07
· 42 commits to master since this release

New Features

  • Global reducers now receive a dispatch function in addition to the dispatch object. This dispatch function asynchronously calls setGlobal and returns the new global state, allowing you to await the change. This is the first step towards sagas. #116
function myReducer(global, dispatch, ...params) {
  await dispatch({ change: 1 }); // <-- dispatch is a function
  await disaptch.someOtherReducer(params); // <-- dispatch is a map
  await dispatch({ change 2 });
}