Skip to content

Instantly share code, notes, and snippets.

@ruprict
Created October 1, 2015 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruprict/aa5071751f64804a3c15 to your computer and use it in GitHub Desktop.
Save ruprict/aa5071751f64804a3c15 to your computer and use it in GitHub Desktop.
var React = require('react');
import cookie from 'redux-effects-cookie';
import type {RequestAction} from '../__types';
import { GET_COOKIE, SET_COOKIE } from '../constants/ActionTypes';
export function setCookie(name, value) {
console.log("SETTING coOOKIE to" + value);
var payload= {};
return {
types: [SET_COOKIE],
payload: payload,
promise(client: any, dispatch, getState): Promise {
return cookie(name, value);
}
};
}
export function getCookie(name) {
var payload= {};
return {
types: [ GET_COOKIE ],
namd: name,
promise(client: any, dispatch, getState): Promise {
return cookie(name);
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment