Skip to content

show use of try block in examples. #79

Open
@bsutton

Description

Thanks for the package.

Just some feedback on the doco.

Every example of calling enable or disable should be awaited.
Whilst technically you don't need to await them it's considered best practice to await or explicitly unawait any async calls.

The examples should also show a try block around any enable/disable calls to ensure that the disable method is called even if an exception is thrown.

await WakelockPlus.enable();
try {

/// do something and an exception might be thrown

}
finally {
/// ensure the wake lock is relased.
await WakelockPlus.disable();
}

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions