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

Optimist actions are not FSA-compliant #2

Closed
neverfox opened this issue Oct 18, 2015 · 4 comments
Closed

Optimist actions are not FSA-compliant #2

neverfox opened this issue Oct 18, 2015 · 4 comments

Comments

@neverfox
Copy link

From flux-standard-action:

An action MUST NOT include properties other than `type`, `payload`, and `error`, and `meta`.

The redux-optimist project is really proposing an extension to the FSA spec (which is under discussion). You have the isFSA check, but it would actually fail if you put the optimist flag on an action. Your tests don't currently seem to cover that case though. So you either shouldn't claim to be FSA-compliant yet, or you should move the optimist flag to meta for the time being.

@Download
Copy link

Lol I came here to suggest the same thing!

Pressed for time now, but I may come back later to work on a PR to change this. Should be a simple change, right?

@Download
Copy link

@mathieudutour Closed without comment? Why?

@mathieudutour
Copy link
Owner

I fixed it in 0.2.1, you now specify the optimist in meta:

export function addTodo(text) {
  return {
    type: 'ADD_TODO',
    payload: {
      promise: loadTodoServiceAndReturnPromise(text),
      text
    },
    meta: {
      optimist: true
    }
  };
}

I'm working on a better doc.

@Download
Copy link

Wow that's great @mathieudutour 👍

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

3 participants