This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Mixin from '@ember/object/mixin'; | |
import Ember from 'ember'; | |
import { singularize } from 'ember-inflector'; | |
export default Mixin.create({ | |
// ember temporary ids | |
_tempIds: {}, | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from "ember-data"; | |
import { computed } from "@ember/object"; | |
import { assert } from "@ember/debug"; | |
const { Model } = DS; | |
Model.reopenClass({ | |
/** | |
* The following props are overrided, since per definition | |
* they are sealed props defined in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//instance-initializers/globals.js | |
export function initialize(application) { | |
let { environment } = application.resolveRegistration('config:environment'); | |
if (environment !== "production") { | |
/** | |
This basically exposes the application, pretty useful because | |
you can use stuff like this from the console. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function initialize(appInstance) { | |
if (typeof FastBoot === 'undefined') { | |
let originalDidCreateRootView = appInstance.didCreateRootView; | |
appInstance.didCreateRootView = function() { | |
let elements = document.querySelectorAll(appInstance.rootElement + ' #app-shell'); | |
for (let i = 0; i < elements.length; i++) { | |
let element = elements[i]; | |
element.parentNode.removeChild(element); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
OlderNewer