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

Provide a wrapper compatible with the library-provided unwrapper #83

Open
amakhrov opened this issue Jun 1, 2017 · 0 comments
Open

Comments

@amakhrov
Copy link

amakhrov commented Jun 1, 2017

The library provides the standard unwrapper (https://github.com/salsita/prism/blob/master/packages/prism-redux/src/unwrappers/buildUnwrapper.ts). This unwrapper assumes a particular format of a wrapped action.

However, there is no standard wrapper compatible with this unwrapper. One has to write it themselves every time.
And if the standard unwrapper changes in future versions, the existing code will break.

A possible approach would be to expose a standard action wrapper:

// buildWrapper.js - a part of the prism library
export default (prefix: string) => (action: string) => `${prefix}.${action}`;


// usage in a component
<InstantiableConnectedCounter
    selector={state => state.topCounter}
    wrapper=buildWrapper('TopCounter')
/>
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

1 participant