karet.fr

An observable wrapper for XMLHttpRequest using Kefir

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
karet.fr
000.1.04 years ago4 years agoMinified + gzip package size for karet.fr in KB

Readme

Karet FR · Gitter GitHub stars
This library provides a thin wrapper over the standard FileReader API. See also Karet XHR.
Examples:
npm version Build Status Code Coverage

Contents

Starting
* [`FR.readAsArrayBuffer(file) ~> fileReader`](#FR-readAsArrayBuffer)
* [`FR.readAsBinaryString(file) ~> fileReader`](#FR-readAsBinaryString)
* [`FR.readAsDataURL(file) ~> fileReader`](#FR-readAsDataURL)
* [`FR.readAsText(file) ~> fileReader`](#FR-readAsText)
State
* [`FR.hasEnded(fileReader) ~> boolean`](#FR-hasEnded)
* [`FR.hasFailed(fileReader) ~> boolean`](#FR-hasFailed)
* [`FR.hasStarted(fileReader) ~> boolean`](#FR-hasStarted)
* [`FR.hasSucceeded(fileReader) ~> boolean`](#FR-hasSucceeded)
* [`FR.isDone(fileReader) ~> boolean`](#FR-isDone)
* [`FR.isProgressing(fileReader) ~> boolean`](#FR-isProgressing)
* [`FR.loaded(fileReader) ~> number`](#FR-loaded)
* [`FR.readyState(fileReader) ~> number`](#FR-readyState)
* [`FR.total(fileReader) ~> number`](#FR-total)
Result
* [`FR.result(fileReader) ~> varies`](#FR-result)
* [`FR.error(fileReader) ~> exception`](#FR-error)

Reference

The interface of this library consists of named exports. Typically one just imports the library as:
import * as FR from 'karet.fr'

Starting

FR.readAsArrayBuffer(file) ~> fileReader

FR.readAsBinaryString(file) ~> fileReader

FR.readAsDataURL(file) ~> fileReader

FR.readAsText(file) ~> fileReader

State

FR.hasEnded(fileReader) ~> boolean

FR.hasFailed(fileReader) ~> boolean

FR.hasStarted(fileReader) ~> boolean

FR.hasSucceeded(fileReader) ~> boolean

FR.isDone(fileReader) ~> boolean

FR.isProgressing(fileReader) ~> boolean

FR.loaded(fileReader) ~> number

FR.readyState(fileReader) ~> number

FR.total(fileReader) ~> number

Result

FR.result(fileReader) ~> varies

FR.error(fileReader) ~> exception