// import { Observable, of, from } from 'rxjs';
import { ajax } from 'rxjs/ajax';
import { map } from 'rxjs/operators';
import { actionCreator } from '../lib/rx/rx-redux';
export const appActions = {
    changeName: actionCreator((payload) => ({
        type: 'NAME_CHANGED',
        payload
    })),
    loadGithubFollowers: actionCreator((payload) => {
        const url = `https://api.github.com/users/${payload.username}/followers`;
        return {
            type: 'GITHUB_FOLLOWERS_LOADING',
            payload: ajax(url).pipe(map((xhr) => map(xhr.response, 'login')), map((followers) => ({
                type: 'GITHUB_FOLLOWERS_LOADED',
                payload: followers
            })))
        };
    })
};
//# sourceMappingURL=app-actions.js.map