-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dispatch #15
Comments
I think we should look at angular ivy. And make one decorator (example): @Component({
...
})
@UseStoreon({
states:['count'],
dispatcher: 'dispatch'
})
export class FooComponent {
public count: Observable<number>;
public dispatch: Function;
} and template: <button (click)="dispatch('inc')">
<span>{{count | async}}</span> like: https://ngxf.gitbook.io/platform/hooks/state-hook |
@irustm it would be fair if I ask -- will storeon/angular support older versions? Yeah, right now peerDependencies are pointed strictly to angular 8+, but not all of the angular projects use version 8 btw, I think your idea is pretty good |
I want the storeon to be used only with Angular Ivy. I hope that Angular Ivy projects will really be 3Kb. For the rest, there are other big solutions, like ngrx, ngxs, akita. |
@maktarsis I updated dispatch in #18 (if it gets merged) a little. Readme also: @irustm you forgot to mention ngxf :D The idea you said above is actually similar to reducer hook. |
@Svetomechc yeah, ngxf: #15 (comment)
|
I think it should be like this:
But I don't like when using decorators with expected types, because TypeScript unsupported type checking with it. So, we can use simple functions for this:
|
I think we can design a much better way to dispatch the things
at least we have to think about that
I still keep in mind that we can leave it as it is.
There are several important factors to consider:
The text was updated successfully, but these errors were encountered: