File

src/modules/firetask/providers/ft-tasks.ts

Description

Tasks Provider

Index

Properties
Methods

Constructor

constructor(events: Events, session: FtSessionProvider, storage: Storage)

Creates an instance of FtTasksProvider

Parameters :
Name Type Optional Description
events Events
session FtSessionProvider
storage Storage

Methods

Public day
day(index: number)

Show name of the day from the index of the week

Parameters :
Name Type Optional Description
index number
Returns : string
Public daysOfWeek
daysOfWeek(entry: )

Days of Week

returns a list of days separated by commas

Parameters :
Name Type Optional Description
entry
Returns : string
Public get
get()

Get once the list of Tasks

returns entire week formatted to display

this.tasks.get().then((daysOfWeek) => console.log);
Returns : Promise<any>
Public persists
persists(days?: any[])

Persists the items in days of week format on local storage

Parameters :
Name Type Optional Description
days any[] true
Returns : Promise<[]>
Private prepare
prepare(snapshot: any)

create an array of days with the tasks inside each day

Parameters :
Name Type Optional Description
snapshot any
Returns : []
Public recovery
recovery()

Recovery items from local storage

Returns : Promise<[]>
Public ref
ref()

Returns the database path reference of tasks

const path = this.tasks.ref();
            console.log(path);
            // output: user/{id}/tasks
Returns : string
Public remove
remove(dayIndex: number, taskIndex: number, task: FtTaskInterface)

Removes a Task from database and storage

Parameters :
Name Type Optional Description
dayIndex number
taskIndex number
task FtTaskInterface
Returns : Promise<any>
reorderByWeekDay
reorderByWeekDay(data: , index: )
Parameters :
Name Type Optional Description
data
index
Returns : any
Public save
save(task: FtTaskInterface)

Persists a task on database and local storage

Parameters :
Name Type Optional Description
task FtTaskInterface
Returns : Promise<any>

Properties

Private days
days: any
Type : any

Map days of week

Public events
events: Events
Type : Events
Public items
items: FtTaskDayInterface[]
Type : FtTaskDayInterface[]

Stores the task list to be accessible through the entire app

Public session
session: FtSessionProvider
Type : FtSessionProvider
Public storage
storage: Storage
Type : Storage
Public storageTasksNamespace
storageTasksNamespace: string
Type : string
Default value : firetask:items

Set namespace of stored tasks

results matching ""

    No results matching ""