Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
ngx-dexie-observable
Advanced tools
Readme
Dexie module for Angular 2.0+ projects
This is a fork of ngx-dexie with rxjs observable implementation
npm install ngx-dexie-observable --save
//...
import { DexieModule, DexieConfig } from 'ngx-dexie';
const config: DexieConfig = {
databaseName: 'AppDatabase',//your database name here
schema: {
friends: '++id, first_name, last_name',
teachers: '++id, first_name, last_name'
} // any schema of your choice
};
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
DexieModule.forRoot(config)
],
providers: [
],
bootstrap: [AppComponent]
})
export class AppModule { }
The DexieModule
provides now a configured Dexie db instance and a Dexie db service, i.e. DexieService
which can be injected anywhere inside the AppModule
.
import { Injectable } from '@angular/core';
import { DexieService } from 'ngx-dexie';
@Injectable()
export class IndexedDbService {
constructor(private dexieService: DexieService) {}
addOneFriend(friendObject: Object) {
this.dexieService.addOne('friends', friendObject);
}
}
dexieService.addOne(table: string, object: Object)
Adds the entry object
to the dexie table table
Returns a promise which when resolved gives the key of the object added, when rejected gives the error that occured.
dexieService.addMultiple(table: string, objects: Object[])
Adds multiple objects
to the dexie table table
Returns a promise which works similar to Dexie bulkAdd()
dexieService.count(table: string)
Returns a promise which when resolved gives the number of objects in the table table
dexieService.addOrUpdateOne(table: string, object: Object, key?: any)
Works similar to Dexie put()
dexieService.addOrUpdateMultiple(table: string, objects: Object[], keys?: any)
Works similar to Dexie bulkPut()
dexieService.deleteOne(table: string, primaryKey: any)
Works similar to Dexie delete()
dexieService.deleteMultiple(table: string, primaryKeys: any[])
Works similar to Dexie bulkDelete()
dexieService.clearAll(table: string)
Works similar to Dexie clear()
dexieService.operateOnEach(table: string, callback: (item: any, idbCursor: any) => any)
Works similar to Dexie each()
dexieService.filter(table: string, filterFunction: (value: any) => boolean)
Works similar to Dexie filter()
dexieService.getByPrimaryKey(table: string, primaryKey: any, callback?: (item: Object) => any)
Works similar to Dexie get()
dexieService.getByKeyToValueMap(table: string, keyValueMap: Object, callback?: (item: Object) => any)
Works similar to Dexie get()
dexieService.getFirstNItemsOfTable(table: string, num: number)
Works similar to Dexie limit()
dexieService.orderBy(table: string, index: string)
Works similar to Dexie orderBy()
dexieService.offset(table: string, ignoreUpto: number)
Works similar to Dexie offset()
dexieService.reverse(table: string)
Works similar to Dexie reverse()
dexieService.toArray(table: string, callback?: (objects: Object[]) => any)
Works similar to Dexie toArray()
dexieService.toCollection(table: string)
Works similar to Dexie toCollection()
dexieService.update(table: string, key: any, changes: Object)
Works similar to Dexie update()
FAQs
Dexie module for Angular 2.0+
The npm package ngx-dexie-observable receives a total of 5 weekly downloads. As such, ngx-dexie-observable popularity was classified as not popular.
We found that ngx-dexie-observable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.