Comments (4)
from ngx-zustand.
you should be able to import it from the lib.|
import { ZustandBaseService } from 'ngx-zustand';
from ngx-zustand.
How can I use the persist store for this I tried but I end up with lots of an errors, could you please help me @JoaoPauloLousada
from ngx-zustand.
import { Injectable } from '@angular/core';
import { ZustandBaseService } from 'ngx-zustand';
interface CounterState {
counter: number;
increment: () => void;
decrement: () => void;
}
@Injectable({
providedIn: 'root',
})
export class CounterService extends ZustandBaseService<CounterState> {
initStore() {
return set => ({
counter: 0,
increment: () => set(state => ({ counter: state.counter + 1 })),
decrement: () => set(state => ({ counter: state.counter - 1 })),
});
}
}
some errors
Error: node_modules/ngx-zustand/lib/zustand-base.service.d.ts:13:53 - error TS1005: '>' expected.
13 useStore<S>(selector: Parameters<typeof useStore<T, S>>[1]): Observable<S>;
~
Error: node_modules/ngx-zustand/lib/zustand-base.service.d.ts:13:58 - error TS1005: ',' expected.
13 useStore<S>(selector: Parameters<typeof useStore<T, S>>[1]): Observable<S>;
~
Error: node_modules/ngx-zustand/lib/zustand-base.service.d.ts:13:60 - error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
13 useStore<S>(selector: Parameters<typeof useStore<T, S>>[1]): Observable<S>;
~~~
Error: node_modules/ngx-zustand/lib/zustand-base.service.d.ts:13:63 - error TS1005: ';' expected.
13 useStore<S>(selector: Parameters<typeof useStore<T, S>>[1]): Observable<S>;
~
Error: node_modules/ngx-zustand/lib/zustand-base.service.d.ts:13:64 - error TS1128: Declaration or statement expected.
13 useStore<S>(selector: Parameters<typeof useStore<T, S>>[1]): Observable<S>;
~
Error: node_modules/ngx-zustand/lib/zustand-base.service.d.ts:13:66 - error TS2348: Value of type 'typeof Observable' is not callable. Did you mean to include 'new'?
13 useStore<S>(selector: Parameters<typeof useStore<T, S>>[1]): Observable<S>;
~~~~~~~~~~~~~
Error: node_modules/ngx-zustand/lib/zustand-base.service.d.ts:13:77 - error TS2304: Cannot find name 'S'.
13 useStore<S>(selector: Parameters<typeof useStore<T, S>>[1]): Observable<S>;
~
Error: node_modules/ngx-zustand/lib/zustand-base.service.d.ts:13:79 - error TS1005: '(' expected.
13 useStore<S>(selector: Parameters<typeof useStore<T, S>>[1]): Observable<S>;
~
Error: node_modules/ngx-zustand/lib/zustand-base.service.d.ts:14:1 - error TS1128: Declaration or statement expected.
14 }
from ngx-zustand.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-zustand.