question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Export bindActions function

See original GitHub issue

Hey,

My use case is the following: I have a library that uses Preact and exposes a public interface on the window object. The library itself creates some components and allows the webpage to interact with them through functions on window.Library.

For instance, calling window.Library.openDialog() should render a Preact component. I need to execute actions from that openDialog function that is not connected to the store through a Connect component. Effectively, I am looking for bound actions that I can run from outside the Preact/Redux zero environment.

I am thinking that you could export the bindActions function and I can create those bound actions when I need to.

Any opinion on that? Let me know if you think there is a better approach to this.

Thanks a lot for this great library! Jawad

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
matheusmlcommented, Dec 14, 2017

@jawadst could you please install the latest version and check if that’s what you wanted?

1reaction
matheusmlcommented, Dec 12, 2017

Ok, I’ll add them in on the next release.

Do this works for you @jawadst:

import { bindActions } from 'redux-zero/utils';

?

Read more comments on GitHub >

github_iconTop Results From Across the Web

bindActionCreators - Redux
bindActionCreators (actionCreators, dispatch). Turns an object whose values are action creators, into an object with the same keys, ...
Read more >
unable to bind actions to component React Redux
1 Answer 1 ; function mapDispatch( ; this · props. ; connect · Actions)( ; export class ; class LoginPage ...
Read more >
How and When to use BindActionCreators | by Kristen Leach
First, we are exporting default and calling the connect function with mapStateToProps and mapDispatchToProps as usual.
Read more >
Provide React Hooks · Issue #1063 · reduxjs/react-redux
easy-peasy-hooks' export default function Todos() { const todos ... named would be able to bind actions with bindActionCreators from redux.
Read more >
Export, Import Functions, Classes, Components in React
In React we create small reusable partials or components. Preferably single responsibility components. Then we import, export, mount, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found