ampatspell / ember-cli-zuglet Goto Github PK
View Code? Open in Web Editor NEW🔥 Easiest way to use Google Firebase services in your Ember.js Octane app
Home Page: https://www.ember-cli-zuglet.com
License: MIT License
🔥 Easiest way to use Google Firebase services in your Ember.js Octane app
Home Page: https://www.ember-cli-zuglet.com
License: MIT License
Or maybe just add notion of identity
for queries
factoryFor(name)
create(name, props)
store.models.generate('foo', Mixin, {}); // throws if exists
store.models.factoryFor('foo') // proxy or null
store.models.create('foo', { ok: true });
Observed should support arrays
feathers: observed().owner('duck').content(owner => {
let ids = owner.duck.data.get('feathers');
return ids.map(id => this.store.doc(`feathers/${id}`).existing());
// returns array of documents which needs to be observed
// all(this.feathers.map(doc => doc.observers.promise)) -- to resolve
}),
Also observer-for
and resolve-observers
should be aware of this
get({source: 'cache'})
: https://firebase.google.com/docs/reference/js/firebase.firestore.GetOptions
ref
reference/base
so that it is available also for url
modeltemplates: model().named('templates/book-cover').mapping(() => ({}))
model().inline(RandomMixin, {
prepare() {
}
})
await doc.observer().until('data.status', 'exists', doc => {
return doc.exists && doc.get('data.status') !== 'pending';
}, 1000);
store.collection('ducks').doc('yellow/feathers/asd')
_internal.ref
is correct but string
is ducks/asd
_adjustments: readOnly('doc.data.adjustments'),
models: models('_adjustments').named(data => `sketch/stage/node/adjustments/${data.get('type')}`).mapping((data, adjustments) => ({ data, adjustments })),
doc has changes, models are not reflecting those. seems like can't exactly observe proxy or something.
await store.doc('pdfs/one`).delete({ optional: true });
something like this:
hooks.beforeEach(async function() {
let store = this.owner.lookup('service:store');
return store.ready;
});
https://firebase.google.com/docs/reference/js/firebase.firestore.GetOptions
ref.child
in favor of ref.ref
toStringExtension
to storage refsRight now metadata stays with isExisting: true
Right now if array has any changes, array content is replaced which forces models()
content to be recreated.
Instead of that do separate adds and removes.
In addition to deserialize
, replaceModelValues
does basically the same.
query()
and doc.load()
can have a fastboot
configuration (cache in memory, in rtdb and so on)cached
, server
and shoebox/fastboot
If model is reusable, it is not recreated, only prepare is called with new values
if reusable is a function:
model().owner('foo', 'bar').named('thing').reusable((owner, prev) => {
let { foo, bar } = prev;
return true;
});
Observed documents stay with fromCache: true
let doc = this.store.doc('ducks/yellow').existing();
let observer = doc.observe();
observer.content // => doc
let query = this.store.collection('ducks').query();
let observer = query.observe();
observer.content // => query
doc
and query
it should be separate from reference itself.
let pdf = store.collection(`pdfs`).doc();
let page = pdf.doc(`pages/${number}`);
// order: observed()
let order = this.store.doc(`orders/${order_id}`).existing();
this.setProperties({ order });
await order.observers.promise;
optional: true
)let doc = batch.save(ref.new({ ok: true }));
store.doc('ducks/yellow').collection('foo/bar/baz')
_internal.ref
is correct but string
is ducks/yellow/baz
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.