You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add meta.reducers for explicit reducer targeting without prefix stripping
Add support for explicitly targeting specific reducers via meta.reducers,
which bypasses normal prefix routing and passes the full action type
unchanged (without prefix stripping).
Features:
- meta.reducers accepts list of reducer names (atoms)
- Bypasses all normal prefix routing when specified
- Passes full action type to reducers WITHOUT prefix stripping
- Logs warning when targeting non-existent reducers
- Empty list results in no-op (no reducers called)
Implementation:
- Modified strip_action_prefix/2 to accept skip_strip parameter
- Updated apply_combined_reducer/5 to detect explicit targeting
- Enhanced filter_reducers_for_action/2 with missing reducer warnings
- Updated documentation for dispatch/4 and Action module
Examples:
# Normal dispatch (prefix stripped)
dispatch(session_id, "user.reload")
# → UserReducer receives "reload"
# Explicit targeting (prefix NOT stripped)
dispatch(session_id, "user.reload", nil, reducers: [:user, :cart])
# → Only :user and :cart called, both receive "user.reload"
# Warning for missing reducers
dispatch(session_id, "reload", nil, reducers: [:nonexistent])
# → Logs: "Missing reducers: [:nonexistent]"
All existing tests pass (148/148).
0 commit comments