Product
Introducing Ruby Support in Socket
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
ngrx-store-localstorage
Advanced tools
Simple syncing between ngrx store and local storage
ngrx-store-localstorage
depends on @ngrx/store and Angular 2.
npm install ngrx-store-localstorage --save
provideStore
.localStorageMiddleware
function, specify the slices of state you would like to keep synced with local storage.initialState
on application bootstrap.import {bootstrap} from 'angular2/platform/browser';
import {TodoApp} from './todo-app';
import {provideStore} from "@ngrx/store";
import {localStorageMiddleware} from "ngrx-store-localstorage";
export function main() {
return bootstrap(TodoApp, [
provideStore({todos, visibilityFilter}),
localStorageMiddleware(['todos', 'visibilityFilter'], true)
])
.catch(err => console.error(err));
}
document.addEventListener('DOMContentLoaded', main);
localStorageMiddleware(keys : string[], rehydrateState : boolean = false)
Provide state (reducer) keys to sync with local storage. Optionally specify whether to rehydrate initialState
from local storage on bootstrap.
keys
(string[]): State keys to sync with local storagerehydrateState
(boolean? = false): Pull initial state from local storage on startupFAQs
State and local storage syncing for @ngrx/store
We found that ngrx-store-localstorage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.
Product
Socket is launching Ruby support for all users. Enhance your Rails projects with AI-powered security scans for vulnerabilities and supply chain threats. Now in Beta!
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.