georgebyte / rxjs-observable-store Goto Github PK
View Code? Open in Web Editor NEWA state management solution implemented using RxJS to mimic Redux architecture.
License: MIT License
A state management solution implemented using RxJS to mimic Redux architecture.
License: MIT License
I'm not exactly sure what is wrong, but it looks like this library does not work with Angular CLI 11.
I created a new app with Angular CLI 11 (using ng new
) and then i added this library using npm install rxjs-observable-store --save
.
Then I imported the store using import { Store } from "rxjs-observable-store";
in one of my TS files.
From this point onward, the app did not work at all and the command ng serve
did not start the app, but also didn't produce any output.
I have prepared a minimal example that reproduces the bug (Simply a fresh Angular CLI app which usesrxjs-observable-store
):
Check out https://github.com/jgosar/rxjs-store-angular-11
Go to folder rxjs-store-angular-11\test-app
Run ng serve
.
You can see that nothing at all happens and no website starts on localhost:4200
Now if you cancel this command and go to app.component.ts
and remove the line import { Store } from "rxjs-observable-store";
, and run ng serve
again, the app starts correctly, so the problem must have something to do with this library.
When I switched back to Angular CLI 10 the app worked again, so this looks like an incompatibility between Angular CLI 11 and rxjs-observable-store.
Hello, @jurebajt ! What do you think about subscribing on partial changes?
store.state$.pipe(
map(state => state.prop1.prop2),
distinctUntilChanges()
)
vs someting like this
store.changes('prop1', 'prop2')
I was installing using 13.0.2 angular stuff. When installing the store I found a peer dependency.
Is it correct to force?
Thank you. Below the output.
Mario
npm install rxjs-observable-store --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/rxjs
npm ERR! rxjs@"~7.4.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer rxjs@"6.x" from [email protected]
npm ERR! node_modules/rxjs-observable-store
npm ERR! rxjs-observable-store@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
First of all, congrats for doing this library. I use it a lot :)
Is it possible to use an array instead of writing the complete path when patching the state ?
Something like this ..
const myPath = ['user', 'age'];
store.patchState(30, ...myPath);
I'm using a deep nested state object and the path needs to be dynamic
Thanks in advance
I installed your library and after the installation angular does not build any more (stops and does not continue without error).
The problem seems to be ts-toolbelt and everything which looks like this.
// prettier-ignore
patchState<
P1 extends keyof Object.Path<S, []>
>(value: Object.Path<S, [P1]>, part1: P1): void;
Once I removed all this the library worked again.
I am using angular 10.0.5 with node 12.16.1
Hi there,
Is there a way to persist the state of our store into the local store or session store?
Thanks,
Edgar
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.