@magic-libraries/http

@magic-libraries/http

promisified XMLHttpRequest for @magic. lib.http is usable as an effect.

installation

npm install --save-exact magic-libraries/http

usage

in a page / component, just use the lib.http function as effect.

plaintext

see ExampleButton for a reference implementation

use it in a page:

export const View = state => ExampleButton({ ...state, url: 'https://jaeh.at')

renders:

Idle

json

see JsonExampleButton for a reference implementation

use it in a page:

export const View = state => JsonExampleButton({  ...state,  url: 'https://magic-libraries.github.io/http/hello.json',})

renders:

Idle

source

the source for this page is in the example directory and gets built and published to github using @magic/core