I've got an Aurelia CLI (0.33) application (Webpack 4, Typescript) and using aurelia-store.
main.ts includes
import { initialState } from './state';
...
aurelia.use.plugin(PLATFORM.moduleName('aurelia-store'), { initialState });
My state.ts
import { Meal } from './models/Meal';
export interface State {
meals: Meal[],
numbers: number[]
}
export const initialState: State = {
meals: [{key: '', name: 'EMPTY', description: '', vegetarian: false}],
numbers: []
};
My view class:
import { connectTo } from 'aurelia-store';
import { pluck } from 'rxjs/operators';
import { State } from './../../state';
@connectTo((store) => store.state.pluck("meals"))
export class BookMeals {
public state: State;
}
If I don't use PLUCK (@connectTo() only), I can use store.meals in my view and all works fine, but when I try to use pluck, I get an error in compiler saying 'TS2339: Property 'pluck' does not exist on type 'Observable<{}>'.'
I have tried: - remove node_modules - yarn install - npm install
and the error is still there.
package.json
...
"aurelia-store": "^1.0.0",
"rxjs": "^6.2.2",
...
Any ideas what could be wrong?