1.0.11 • Published 2 years ago

@laravel-streams/streams-api v1.0.11

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Streams JS Client Api

Api Docs

A cohesive development system for building, administrating, and interacting with data-driven Laravel applications.

Intro

todo

Examples

Setup

import { Streams } from '@laravel-streams/streams-api';

const streams = new Streams({
    baseURL: 'http://localhost/api',
});


async function run(){
    const stream = await streams.make('clients')
    const clients = await stream.entries()
                                .where('age', '>', 5)
                                .where('age', '<', 50)
                                .orderBy('age', 'asc')
                                .get();
    for(const client of clients){
        client.email;
        client.age;
    }
}

Extending

Several classes contain hooks.

More information will be provided before final release. The Api Docs will also cover these.

import { Streams } from '@laravel-streams/streams-api';

const streams = new Streams({
    baseURL: 'http://localhost/api',
});

streams.hooks.createRequest.tap('NAME', request => {
    // alter request
    return request;
})
streams.hooks.request.tap('NAME', request => {
    // alter request
    return request;
})
streams.hooks.response.tap('NAME', (response,request) => {
    // alter response
    return response;
})
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago