goatslacker / goatslacker/alt

Descriptive error message when passing a class to generateActions

Open
#603 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.4k
Forks
312
PR merge metrics
No merged PRs in 30d

Description

I kept getting the error 'Invalid reference action passed in' or when using bindActions I got ...Actions.default.fetch is not a function

After a while I noticed I used

export default alt.generateActions(Class) instead of createActions(Class)

Maybe a check if object is class and output an error use createActions when passing a class?

Could save someone a lot of time.

Contributor guide

Open the contributing guide

Research direction

Start by locating the generateActions and createActions entry points and reproduce the behavior when a class is passed to generateActions. Compare the resulting errors with the requested guidance. Done means the misuse produces a descriptive message directing users to createActions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.