Platform: Bad exports, or incorrect syntax in sample

Created on 4 Jan 2018  路  5Comments  路  Source: ngrx/platform

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report  
[ ] Feature request
[ ] Documentation issue or request

What is the current behavior?


Using the following snippets from the example app, throws a compile error

`
import { Store, select } from '@ngrx/store';

constructor(private store: Store) {
/**
* Selectors can be applied with the select operator which passes the state
* tree to the provided selector
*/
this.showSidenav$ = this.store.pipe(select(fromRoot.getShowSidenav));
this.loggedIn$ = this.store.pipe(select(fromAuth.getLoggedIn));
}
`

@ngrx/effects/effects"' has no exported member 'ofType @ngrx/store/store has no exported member 'select'

It appears the example app references the store.ts from the src directory directly, while the package references the transpiled js, which is not showing to have a select function export.

Expected behavior:

Example App code should compile when not included in full platform repo

Minimal reproduction of the problem with instructions:

Create new ng app
ng new some-app

Replace code in /src/app with code from example-app/src/app
Install npm packages

"@angular/cdk": "^5.0.3", "@ngrx/effects": "^4.1.1", "@ngrx/router-store": "^4.1.1", "@ngrx/store": "^4.1.1", "@ngrx/store-devtools": "^4.1.1", "core-js": "^2.4.1", "ngrx-store-freeze": "^0.2.0"

Version of affected browser(s),operating system(s), npm, node and ngrx:

node: 9.3.0
npm: 5.51
typescript: 2.6.1

Other information:

Most helpful comment

That feels like an odd release / branch management strategy to have un-released features in master, and examples / documentation citing code that is non-functional with the latest release.

All 5 comments

The example reflects what's in master, which will be in the next major release.

That feels like an odd release / branch management strategy to have un-released features in master, and examples / documentation citing code that is non-functional with the latest release.

Also, when is the next major release scheduled?

We can update the docs to point to the latest released version. You can see it here https://github.com/ngrx/platform/blob/v4.1.1/docs/store/README.md

I agree. With liqdfire, I was trying to get my effect to work and decided to try and make my code match the github docs and to find that 'ofType' is not being exported from '@ngrx/effects'. (though it does appear in the effects.js file)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bhaidar picture bhaidar  路  3Comments

axmad22 picture axmad22  路  3Comments

shyamal890 picture shyamal890  路  3Comments

doender picture doender  路  3Comments

brandonroberts picture brandonroberts  路  3Comments