Skip to content

Instantly share code, notes, and snippets.

View betocantu93's full-sized avatar
🏠
Working from home

Alberto Cantú Gómez betocantu93

🏠
Working from home
View GitHub Profile
copyToNoneLocal: task(function* (draft, ignoreModel = null, level = 0) {
try {
let draftType = draft.modelName;
let modelType = draftType.replace('-local', '');
let model = this.store.createRecord(modelType);
let mixedProperties = [];
let relationships = [];
let properties = []
@betocantu93
betocantu93 / bucket.js
Last active March 22, 2019 22:59
Bucket Storage. Fast util for persisting and retrieving from local or session storage it's also bucket oriented
const DEFAULT_BUCKET_NAME = "general";
const DEFAULT_TYPE = "local";
/*
* Storage class should be used as follow:
*
* @param string "session" || "local" //default local
* @param string Bucket Name, where following objects will be stored, it's like a namespace.
*
* const storage = Storage("local", "tables");