-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support for array methods like arrayUnion #295
Comments
@ampatspell I think this is needed. I also want to work on this! So, can you please review this and make some changes to make it better. Idea is to make |
currently there is import { serverTimestamp, arrayUnion } from 'zuglet/store';
let a = serverTimestamp();
let b = arrayUnion(arg); essentially also |
"firebase/firestore" also exports methods like doc, setDoc, addDoc, collection. // models/message.js
import EmberObject from '@ember/object';
import { inject as service } from '@ember/service';
import { activate } from 'zuglet/decorators';
import { doc } from 'zuglet/store';
export default class Message extends EmberObject {
@tracked id;
@activate().content(
({ store, id }) => doc(`messages/${id}`).existing()
) doc;
} Injecting a store in models every time is like sticking with something tightly. It's like a boilerplate. |
regarding
|
I don't think people will use 2 or more firebase projects in their ember app. What do you think? |
Can you please tell me what is |
that's certainly something I want to support for dashboard-style applications |
that is ember-cli blueprint variable, those files are used to generate store, application route when you do |
What are dashboard-style applications? Why do those applications need multiple stores? |
@ampatspell Can you please reply? |
Oh, sorry, missed your comment. Let's say you have multiple firebase apps (separate projectIds) and you want to build some kind of overview dashboard app that shows information gathered from all the apps. |
It makes sense. import { serverTimestamp, arrayUnion } from 'zuglet/store'; Do you have anything in mind to refine this? |
Looks good to me |
@ampatspell |
@ampatspell I tried to understand the code but it is really hard to understand it without documentation. Can you please write the architecture of the library with a UML diagram? |
That would be way too much effort. Everything revolves around custom registry registrations: https://github.com/ampatspell/ember-cli-zuglet/blob/master/app/initializers/zuglet-internal.js Basically there are 2 bigger groups of code:
|
Description
Exports methods like arrayUnion
Change from current to suggested
Current
Suggested
The text was updated successfully, but these errors were encountered: