@preignition/lit-firebase
v0.4.0
Published
Webcomponent for interactig with Firebase, inspired by polymerfire, but based on lit-element
Downloads
1
Maintainers
Readme
<preignition/lif>
This webcomponent follows the open-wc recommendation.
A lit-element based implementation of polymerfire.
For the time being, only firebase-document
and firebase-query
have been migrated (to resp. lif-document
and lif-query
).
firebase-auth
and firebase-app
will not be upgraded as it is usually simpler to instantiate database and handle authentication via js.
Those components require firebase SDK to be made available on the client (see https://firebase.google.com/docs/web/setup).
Use at your own risks as this is beta product.
Installation
npm i @preignition/lifbase
Usage
<script type="module">
import '@preignition/lifbase';
</script>
and in lit-element render:
<lif-document path="myPath" @data-changed="${e=> this.data = e.detail.value}"></lif-document>
<lif-query path="myPath" @data-changed="${e=> this.data = e.detail.value}"></lif-query>
Testing with Karma
To run the suite of karma tests, run
npm run test
or to run them in compatibility mode for legacy browsers
npm run test:compatibility
To run the tests in watch mode (for TDD, for example), run
npm run test:watch
or
npm run test:compatibility