
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
@angular-redux/store
Advanced tools
@angular-redux/store@^9
is what you need. This consumes breaking changes from RxJS and Angular 6, as well as updated typedefs from Redux 4.
Use @angular-redux/store@^7
- this version supports Angular 5, and also changes to using lettable operators.
Use @angular-redux/store@^6
- This supports Angular 4 and earlier.
@angular-redux/store@6
?Where possible, I will be maintaining and applying any fixes / enhancements for v7 into v6 where it does not introduce a breaking change.
I made a few mistakes trying to publish fixes / etc to two major versions, which caused some releases to get tagged incorrectly and caused some confusion. Sorry for any confusion this has caused, and will do better on avoiding this in the future, and being more transparent with the releases that are going out.
Angular bindings for Redux.
For Angular 1 see ng-redux
Redux is a popular approach to managing state in applications. It emphasises:
You can find lots of excellent documentation here: Redux.
We provide a set of npm packages that help you integrate your redux store into your Angular 2+ applications. Our approach helps you by bridging the gap with some of Angular's advanced features, including:
NgModule
and Ahead-of-Time compilation.@angular-redux/store
has a peer dependency on redux, so we need to install it as well.
npm install --save redux @angular-redux/store
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './containers/app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
Import the NgReduxModule
class and add it to your application module as an
import
. Once you've done this, you'll be able to inject NgRedux
into your
Angular components. In your top-level app module, you
can configure your Redux store with reducers, initial state,
and optionally middlewares and enhancers as you would in Redux directly.
import { NgReduxModule, NgRedux } from '@angular-redux/store';
import { createLogger } from 'redux-logger';
import { rootReducer } from './reducers';
interface IAppState {
/* ... */
}
@NgModule({
/* ... */
imports: [, /* ... */ NgReduxModule],
})
export class AppModule {
constructor(ngRedux: NgRedux<IAppState>) {
ngRedux.configureStore(rootReducer, {}, [createLogger()]);
}
}
Or if you prefer to create the Redux store yourself you can do that and use the
provideStore()
function instead:
import {
applyMiddleware,
Store,
combineReducers,
compose,
createStore,
} from 'redux';
import { NgReduxModule, NgRedux } from '@angular-redux/store';
import { createLogger } from 'redux-logger';
import { rootReducer } from './reducers';
interface IAppState {
/* ... */
}
export const store: Store<IAppState> = createStore(
rootReducer,
applyMiddleware(createLogger()),
);
@NgModule({
/* ... */
imports: [, /* ... */ NgReduxModule],
})
class AppModule {
constructor(ngRedux: NgRedux<IAppState>) {
ngRedux.provideStore(store);
}
}
Note that we're also using a Redux middleware from the community here: redux-logger. This is just to show off that
@angular-redux/store
is indeed compatible with Redux middlewares as you might expect.Note that to use it, you'll need to install it with
npm install --save redux-logger
and type definitions for it withnpm install --save-dev @types/redux-logger
.
Now your Angular app has been reduxified! Use the @select
decorator to
access your store state, and .dispatch()
to dispatch actions:
import { select } from '@angular-redux/store';
@Component({
template:
'<button (click)="onClick()">Clicked {{ count | async }} times</button>',
})
class App {
@select() count$: Observable<number>;
constructor(private ngRedux: NgRedux<IAppState>) {}
onClick() {
this.ngRedux.dispatch({ type: INCREMENT });
}
}
Here are some examples of the angular-redux
family of packages in action:
@angular-redux/store
uses an approach to redux based on RxJS Observables to select
and transform
data on its way out of the store and into your UI or side-effect handlers. Observables
are an efficient analogue to reselect
for the RxJS-heavy Angular world.
Read more here: Select Pattern
We also have a number of 'cookbooks' for specific Angular topics:
Want to hack on angular-redux/store or any of the related packages? Feel free to do so, but please test your changes before making any PRs.
Here's how to do that:
npm test
.npm run lint
.git clone https://github.com/angular-redux/example-app.git
)cd
to your angular-redux/store
clone and run npm pack
). This will create a .tgz
file.cd
to your example-app clone and run npm install --save /path/to/the/tgz/file/from/above
)ng serve --aot
Please make sure your changes pass Angular's AoT compiler, because it's a bit finicky with TS syntax.
10.0.0 (2019-05-04)
FAQs
Angular bindings for Redux
The npm package @angular-redux/store receives a total of 9,829 weekly downloads. As such, @angular-redux/store popularity was classified as popular.
We found that @angular-redux/store demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.