ionic-team / stencil-redux

MIT License
97 stars 20 forks source link

update stencil/core and fix #69 #70

Closed stanley85 closed 4 years ago

stanley85 commented 4 years ago

Stencil issue https://github.com/ionic-team/stencil/issues/2015 Redux issue https://github.com/ionic-team/stencil-redux/issues/69

This is the adapted solution, dev build works without error - build script runs without error

imhoffd commented 4 years ago

I think more work is necessary. If you inspect the dist/ directory, there are no .js or .mjs files.

I think this library needs to be completely rewritten for Stencil 1. Not only do we need to fix up stuff like this, we need to abandon the legacy context system and recommend a completely new way of using this library.

stanley85 commented 4 years ago

Would be awesome to have a syntax like this as soon as redux is available to a stencil project.

@Store({ name: 'default', action: this.documentChange, type: 'redux' }) document: any = {};

Each member decorated with @Store shares the same store. Action is associated with the redux action. @Store Decorator would inherit behaviour from @State. Name could be the name of the reducer.

Having the type as an optional parameter (default = 'redux') could allow to further define custom stores. Maybe a dynamic store for firebase could allow for a simple change like eg.

@Store({ name: 'default', action: this.documentChange, type: 'firestore' }) document: any = {};

Name could be the name of the database document.