angular-redux

Testing Angular with @angular-redux/store in Storybook

雨燕双飞 提交于 2021-01-29 08:14:06
问题 I wrote this up on @angular-redux/store and was wondering if a solution already existed. https://github.com/angular-redux/store/issues/551 Here's a recap to save you from reading the link: Using Angular and Storybook has worked out well so far. However, I have cases where my component is dependent upon @select(). How can I tell the component in my story to use a mocked observable or data point? Here's my sample code: import { storiesOf, moduleMetadata } from '@storybook/angular'; import {

In angular (v5) how do I listen to my apps Redux state object changing?

白昼怎懂夜的黑 提交于 2019-12-30 12:13:30
问题 I need to know how to create a listener e.g. I want to subscribe to the AppState changing. Below is my current very basic service. I have a dispatch action on the view which increments the counter. Once the counter changes value I'd like to detect this in other parts of my website e.g. the global header for example. I'm using ng2-Redux with angular version 5. Redux service: export interface IAppState { counter: number; } export const INITIAL_APP_STATE: IAppState = { counter: 0 }; export

Why redux @select does not work even though the state is changed when using redux-state-sync?

人走茶凉 提交于 2019-12-11 10:59:25
问题 EDIT - This all works if I configure redux-state-sync to use localstorage. I made a repository https://bitbucket.org/em-aitch/sync-app/src/master/ that contains example of working code. If broadcastchannel type (app.component.ts : 76) is changed from 'localstorage' to 'native' the bindings (both @select and {{ property }} don't work anymore! EDIT2 - Question How to find out what breaks Angular binding? answers this question I have setup using redux-state-sync described below. The redux state

In angular (v5) how do I listen to my apps Redux state object changing?

你说的曾经没有我的故事 提交于 2019-12-01 12:13:58
I need to know how to create a listener e.g. I want to subscribe to the AppState changing. Below is my current very basic service. I have a dispatch action on the view which increments the counter. Once the counter changes value I'd like to detect this in other parts of my website e.g. the global header for example. I'm using ng2-Redux with angular version 5. Redux service: export interface IAppState { counter: number; } export const INITIAL_APP_STATE: IAppState = { counter: 0 }; export function appReducer(state: IAppState, action: any): IAppState { switch (action.type) { case 'INCREMENT':