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

rxjs_1.Observable.create(...).finally is not a function #23

Closed
gregoryjjb opened this issue May 2, 2018 · 5 comments
Closed

rxjs_1.Observable.create(...).finally is not a function #23

gregoryjjb opened this issue May 2, 2018 · 5 comments
Assignees

Comments

@gregoryjjb
Copy link

Possible noob question, I have the minimum possible Undux store setup but when I call withStore I get that error.

My store (taken from readme example):

import { connect, createStore } from 'undux'

// Create a store with an initial value.
let store = createStore({
    sessionKey: '',
    sessionFetching: false,
})

export let withStore = connect(store);

Where I use withStore:

import React, { Component } from 'react';
import { withStore } from 'utils/store';

const App = withStore(({ store }) =>  // This call causes the error
	<div>
		<h1>gChat</h1>
		<p>Session:{}</p>
	</div>
)

export default App;

The error (x2):

TypeError: rxjs_1.Observable.create(...).finally is not a function
Emitter../node_modules/typed-rx-emitter/index.js.Emitter.createChannel

I'm using regular JS with create-react-app, not typescript; is that the problem? Any advice is much appreciated.

(Also great library, exactly what I was looking for after the verbosity of Redux!)

@bcherny
Copy link
Owner

bcherny commented May 3, 2018

Hi @gregdumb! From the error message, it's not clear what's throwing the error. Think you can put a self-contained, reproducible example in a zip (or better yet, on Stackblitz or Codepen) so I can reproduce what you're seeing?

As a first step, how are you including RxJS in your build?

@bcherny bcherny self-assigned this May 3, 2018
@gregoryjjb
Copy link
Author

gregoryjjb commented May 3, 2018

As a first step, how are you including RxJS in your build?

You made me realize that I had installed RxJS ^6.0.0, so I tried with ^5.0.0 and that works! Is 6 not supported?

Edit: made branch here that demonstrates the break.

@bcherny
Copy link
Owner

bcherny commented May 3, 2018

Good to hear! It seems like Rx6 is still in RC, but in the meantime I will do a couple of things:

  1. Give a better error if Rx 5 is missing, so you can find out quickly Better error when Rx5 is missing #24
  2. Investigate supporting both Rx 5 and 6 concurrently
  3. Investigate making the Rx library pluggable investigate using a lighter weight rx library than rxjs #8

@bcherny bcherny closed this as completed May 3, 2018
@bcherny
Copy link
Owner

bcherny commented May 6, 2018

@gregdumb Undux 4.3 is shipped, with out of the box support for both Rx6 and Rx5.

@gregoryjjb
Copy link
Author

Wow sweet! Appreciate the fast turnaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants