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 { Markdown } from "@/app/components/markdown"; | |
import { getComments, getPost } from "@/lib/db"; | |
import { Suspense } from "react"; | |
export default async function PostPage({ | |
params, | |
}: { | |
params: { postId: string }; | |
}) { | |
let post = await getPost(params.postId); |
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
module.exports.addDefaultImport = function addImport(tree, mod, name) { | |
tree.children.unshift({ | |
type: 'import', | |
value: `import _${name} from '${mod}'`, | |
}); | |
return `_${name}`; | |
}; |
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
function useDebounced(value, timeout) { | |
let [debouncedValue, setDebouncedValue] = useState(value) | |
useEffect(() => { | |
let timeoutId = setTimeout(() => { | |
setDebouncedValue(value) | |
}, timeout) | |
return () => { | |
clearTimeout(timeoutId) |
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 { usePrevious } from "./use-previous"; | |
import { useRef, useEffect } from "react"; | |
export const useDependsOn = ( | |
value, | |
functionToRun, | |
{ initial = true } = {} | |
) => { | |
let serialized = JSON.stringify(value); | |
let previous = usePrevious(serialized); |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
actions: { | |
update(key, value) { | |
console.log(`updating ${key} to ${value}`); | |
this.model.set(`variables.${key}`, value); | |
} |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
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
// tests/helpers/fullscreen.js | |
import $ from 'jquery'; | |
import { registerAsyncHelper } from '@ember/test'; | |
export default registerAsyncHelper('fullscreen', function() { | |
window.QUnit.config.testTimeout = 9999999; | |
$('#ember-testing-container').css({ | |
background: 'initial', |
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
store: Ember.inject.service(), | |
didInsertElement() { | |
let store = this.get('store'); | |
let model = store.createRecord('my-model'); | |
this.set('model', model); | |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'x' | |
}); |
NewerOlder