This file contains hidden or 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
// Types for the result object with discriminated union | |
type Success<T> = { | |
data: T; | |
error: null; | |
}; | |
type Failure<E> = { | |
data: null; | |
error: E; | |
}; |
This file contains hidden or 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
/** | |
* An enum representing the possible states of UI features | |
* | |
* These states help design consistent user experiences across different | |
* scenarios like loading, empty states, errors, and varying data quantities. | |
*/ | |
export enum State { | |
/** | |
* The starting state before any user interaction or data loading. | |
* Example: A search page before the user has entered a query. |
This file contains hidden or 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
// Goes into theme file | |
$tecton-variable-shims: ( | |
--t-primary: 400, | |
--t-secondary: 500, | |
--t-tertiary: 700 | |
); | |
// Goes into Tecton files | |
$tecton-variable-shims: () !default; | |
[data-tecton-module] { |
This file contains hidden or 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
@use "sass:list"; | |
@function is-variable-ref($string) { | |
@return str-slice(#{$string}, 0, 2) == '--'; | |
} | |
@function is-variable($string) { | |
@return str-slice(#{$string}, 0, 3) == 'var'; | |
} |
This file contains hidden or 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
@use "sass:list"; | |
@function is-variable-ref($string) { | |
@return str-slice(#{$string}, 0, 2) == '--'; | |
} | |
@function is-variable($string) { | |
@return str-slice(#{$string}, 0, 3) == 'var'; | |
} |
This file contains hidden or 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
{ | |
"sass": { | |
"compiler": "dart-sass/1.26.11", | |
"extensions": {}, | |
"syntax": "SCSS", | |
"outputStyle": "expanded" | |
}, | |
"autoprefixer": false | |
} |
This file contains hidden or 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 createFragment(markup) { | |
const fragment = document.createRange().createContextualFragment(markup); | |
return fragment.firstChild; | |
} | |
const btnContainer = createFragment(` | |
<div class="container"> | |
<button>Click Me</button> | |
</div> | |
`) |
This file contains hidden or 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({ | |
testArray: [], | |
didReceiveAttrs() { | |
this._super(...arguments); | |
const elementId = this.get('elementId') | |
this.get('testArray').push(elementId) | |
} |
This file contains hidden or 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({ | |
testArray: [], | |
didInsertElement() { | |
this._super(...arguments); | |
const elementId = this.get('elementId') | |
this.get('testArray').push(elementId) |
This file contains hidden or 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 { ApolloServer, gql } = require('apollo-server-lambda'); | |
const MongoClient= require('mongodb/lib/mongo_client'); | |
if (process.env.NODE_ENV !== 'production') { | |
require('dotenv').load() | |
} | |
const DB_URI = process.env.DB_URI | |
const DB_NAME = process.env.DB_NAME |
NewerOlder