Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples for "meta" #18

Open
ronag opened this issue Sep 18, 2015 · 1 comment
Open

Examples for "meta" #18

ronag opened this issue Sep 18, 2015 · 1 comment

Comments

@ronag
Copy link

ronag commented Sep 18, 2015

Right now it is a bit diffuse when one should use meta over payload. Some more descriptive examples might be a good idea?

@queckezz
Copy link

From my perspective, I think payload is used for data that is necessary to update a given state to a new state whereas meta can be used for literally anything, commonly middleware. It's extra Information.

A good example of using meta is redux-effects, where it's used to define future step()s for an effect. This is not necessary for updating the current state but for the middleware:

{
  type: 'FETCH',
  payload: {url: '/some/thing', method: 'GET'},
  meta: {
    steps: [
      [success, failure]
    ]
  }
}

and it's used in: redux-effects#L16

Fafruch added a commit to Fafruch/kalkulator-agch that referenced this issue Sep 9, 2017
This commit includes structural changes in the way the subject is
updated. It uses destructuring and universal updateSubject function
for updating both name and scores. The actions are built with resepct to
Flux Standard Action, but don't contain meta property.
This is due to this topic:
redux-utilities/flux-standard-action#18

id and subjectsType are essential for all the actions so they're kept
in payload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants